mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-21 01:02:59 +08:00
parent
3828c5c461
commit
2606158c38
@ -14,7 +14,7 @@
|
||||
"website-dev": "webpack-dev-server --config ./website/webpack.config.js"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.10.5",
|
||||
@ -27,7 +27,7 @@
|
||||
"@types/lodash": "^4.14.159",
|
||||
"@typescript-eslint/eslint-plugin": "^3.7.0",
|
||||
"@typescript-eslint/parser": "^3.7.0",
|
||||
"@vue/compiler-sfc": "^3.0.0-rc.1",
|
||||
"@vue/compiler-sfc": "^3.0.0-rc.5",
|
||||
"@vue/component-compiler-utils": "^3.2.0",
|
||||
"algoliasearch": "^4.4.0",
|
||||
"babel-loader": "^8.1.0",
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -14,13 +14,14 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, computed, ref } from 'vue'
|
||||
import { defineComponent, computed, ref, PropType } from 'vue'
|
||||
|
||||
const ERROR_EVENT = 'error'
|
||||
export default defineComponent({
|
||||
name: 'ElAvatar',
|
||||
props: {
|
||||
size: {
|
||||
type: [Number, String],
|
||||
type: [Number, String] as PropType<number | string>,
|
||||
validator(this: never, val: unknown) {
|
||||
if (typeof val === 'string') {
|
||||
return ['large', 'medium', 'small'].includes(val)
|
||||
@ -36,17 +37,28 @@ export default defineComponent({
|
||||
return ['circle', 'square'].includes(val)
|
||||
},
|
||||
},
|
||||
icon: String,
|
||||
src: String,
|
||||
alt: String,
|
||||
srcSet: String,
|
||||
error: Function,
|
||||
icon: {
|
||||
type: String,
|
||||
default: undefined,
|
||||
},
|
||||
src: {
|
||||
type: String,
|
||||
default: undefined,
|
||||
},
|
||||
alt: {
|
||||
type: String,
|
||||
default: undefined,
|
||||
},
|
||||
srcSet: {
|
||||
type: String,
|
||||
default: undefined,
|
||||
},
|
||||
fit: {
|
||||
type: String,
|
||||
default: 'cover',
|
||||
},
|
||||
},
|
||||
emits: ['error'],
|
||||
emits: [ERROR_EVENT],
|
||||
setup(props, { emit }) {
|
||||
const hasLoadError = ref(false)
|
||||
|
||||
@ -80,7 +92,7 @@ export default defineComponent({
|
||||
|
||||
function handleError(e: Event) {
|
||||
hasLoadError.value = true
|
||||
emit('error', e)
|
||||
emit(ERROR_EVENT, e)
|
||||
}
|
||||
return {
|
||||
hasLoadError, avatarClass, sizeStyle, handleError,
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@element-plus/button": "^0.0.0",
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1",
|
||||
"vue": "^3.0.0-rc.5",
|
||||
"vue-router": "^4.0.0-beta.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -8,9 +8,9 @@
|
||||
"@element-plus/utils": "^0.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -1,7 +1,7 @@
|
||||
import isServer from '@element-plus/utils/isServer'
|
||||
import { on } from '@element-plus/utils/dom'
|
||||
|
||||
import type { DirectiveBinding, ObjectDirective, VNode, ComponentPublicInstance } from 'vue'
|
||||
import type { DirectiveBinding, ObjectDirective, ComponentPublicInstance } from 'vue'
|
||||
|
||||
type DocumentHandler = <T extends Event>(mouseup: T, mousedown: T) => void;
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -1,5 +1,10 @@
|
||||
import { defineComponent, computed, inject, h } from 'vue'
|
||||
import type { PropType } from 'vue'
|
||||
|
||||
type SizeObject = {
|
||||
span: number
|
||||
offset: number
|
||||
}
|
||||
const ElCol = defineComponent({
|
||||
name: 'ElCol',
|
||||
props: {
|
||||
@ -7,14 +12,38 @@ const ElCol = defineComponent({
|
||||
type: Number,
|
||||
default: 24,
|
||||
},
|
||||
offset: Number,
|
||||
pull: Number,
|
||||
push: Number,
|
||||
xs: [Number, Object],
|
||||
sm: [Number, Object],
|
||||
md: [Number, Object],
|
||||
lg: [Number, Object],
|
||||
xl: [Number, Object],
|
||||
offset: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
pull: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
push:{
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
xs: {
|
||||
type: [Number, Object] as PropType<number | SizeObject>,
|
||||
default: () => ({} as SizeObject),
|
||||
},
|
||||
sm: {
|
||||
type: [Number, Object] as PropType<number | SizeObject>,
|
||||
default: () => ({} as SizeObject),
|
||||
},
|
||||
md: {
|
||||
type: [Number, Object] as PropType<number | SizeObject>,
|
||||
default: () => ({} as SizeObject),
|
||||
},
|
||||
lg: {
|
||||
type: [Number, Object] as PropType<number | SizeObject>,
|
||||
default: () => ({} as SizeObject),
|
||||
},
|
||||
xl: {
|
||||
type: [Number, Object] as PropType<number | SizeObject>,
|
||||
default: () => ({} as SizeObject),
|
||||
},
|
||||
},
|
||||
setup(props, { slots }) {
|
||||
const gutter = inject('ElRow', 0)
|
||||
@ -30,14 +59,14 @@ const ElCol = defineComponent({
|
||||
})
|
||||
const classList = computed(() => {
|
||||
const ret: string[] = []
|
||||
const pos: ['span', 'offset', 'pull', 'push'] = ['span', 'offset', 'pull', 'push']
|
||||
const pos = ['span', 'offset', 'pull', 'push'] as const
|
||||
pos.forEach(prop => {
|
||||
const size = props[prop]
|
||||
if (typeof size === 'number' && size >= 0) {
|
||||
ret.push(prop !== 'span' ? `el-col-${prop}-${props[prop]}` : `el-col-${props[prop]}`)
|
||||
}
|
||||
})
|
||||
const sizes: ['xs', 'sm', 'md', 'lg', 'xl'] = ['xs', 'sm', 'md', 'lg', 'xl']
|
||||
const sizes = ['xs', 'sm', 'md', 'lg', 'xl'] as const
|
||||
sizes.forEach(size => {
|
||||
if (typeof props[size] === 'number') {
|
||||
ret.push(`el-col-${size}-${props[size]}`)
|
||||
|
@ -6,8 +6,14 @@ export default defineComponent({
|
||||
type: String,
|
||||
default: 'div',
|
||||
},
|
||||
gutter: Number,
|
||||
type: String,
|
||||
gutter: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
justify: {
|
||||
type: String,
|
||||
default: 'start',
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -40,7 +40,7 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, computed, ref, PropType } from 'vue'
|
||||
// notificationVM is an alias of vue.VNode
|
||||
import type { NotificationVM } from './notification.constants'
|
||||
import type { NotificationVM } from './notification'
|
||||
import { eventKeys } from '../../utils/aria'
|
||||
import { on, off } from '../../utils/dom'
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -22,7 +22,10 @@ export default defineComponent({
|
||||
type: String,
|
||||
default: () => t('el.pageHeader.title'),
|
||||
},
|
||||
content: String,
|
||||
content: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
emits: ['back'],
|
||||
setup(props, { emit }) {
|
||||
|
@ -5,7 +5,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -74,6 +74,7 @@ describe('Radio', () => {
|
||||
})
|
||||
const vm = wrapper.vm as any
|
||||
await wrapper.trigger('click')
|
||||
await nextTick()
|
||||
expect(vm.changeData).toEqual('3')
|
||||
})
|
||||
|
||||
@ -156,6 +157,7 @@ describe('Radio group', () => {
|
||||
|
||||
const radio2 = wrapper.findComponent({ ref: 'radio2' })
|
||||
await radio2.trigger('click')
|
||||
await nextTick()
|
||||
const vm = wrapper.vm as any
|
||||
expect(vm.data).toEqual(6)
|
||||
})
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -4,10 +4,9 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -7,9 +7,9 @@
|
||||
"@element-plus/utils": "^0.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
@ -65,7 +65,7 @@ cat > $DIRNAME/package.json <<EOF
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
"vue": "^3.0.0-rc.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0"
|
||||
|
Loading…
Reference in New Issue
Block a user