chore(core): fix linting (#387)

This commit is contained in:
Herrington Darkholme 2020-10-04 14:49:39 +08:00 committed by GitHub
parent e900aac6ea
commit 8844187da6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 15 additions and 14 deletions

View File

@ -4,7 +4,7 @@
"main": "dist/index.js",
"license": "MIT",
"peerDependencies": {
"vue": "^3.0.0-rc.7"
"vue": "^3.0.0"
},
"devDependencies": {
"@vue/test-utils": "^2.0.0-beta.0"

View File

@ -4,7 +4,7 @@
"main": "dist/index.js",
"license": "MIT",
"peerDependencies": {
"vue": "^3.0.0-rc.9"
"vue": "^3.0.0"
},
"devDependencies": {
"@vue/test-utils": "^2.0.0-beta.3"

View File

@ -4,7 +4,7 @@
"main": "dist/index.js",
"license": "MIT",
"peerDependencies": {
"vue": "^3.0.0-rc.5"
"vue": "^3.0.0"
},
"devDependencies": {
"@vue/test-utils": "^2.0.0-beta.0"

View File

@ -2,7 +2,7 @@ import { h, nextTick } from 'vue'
import Message from '../src/index.vue'
import * as domExports from '../../utils/dom'
import { mount } from '@vue/test-utils'
import { eventKeys } from '@element-plus/utils/aria'
import { EVENT_CODE } from '@element-plus/utils/aria'
const AXIOM = 'Rem is the best girl'
@ -177,8 +177,8 @@ describe('Message.vue', () => {
const wrapper = _mount({ slots: { default: AXIOM } })
const event = new KeyboardEvent('keydown', {
keyCode: eventKeys.esc,
} as any)
code: EVENT_CODE.esc,
})
const oldClose = wrapper.vm.close
wrapper.vm.close = jest.fn(() => oldClose())
document.dispatchEvent(event)

View File

@ -4,7 +4,7 @@
"main": "dist/index.js",
"license": "MIT",
"peerDependencies": {
"vue": "^3.0.0-rc.9"
"vue": "^3.0.0"
},
"devDependencies": {
"@vue/test-utils": "^2.0.0-beta.3"

View File

@ -36,7 +36,7 @@
import { defineComponent, computed, ref, PropType } from 'vue'
// MessageVM is an alias of vue.VNode
import type { MessageVM } from './types'
import { eventKeys } from '../../utils/aria'
import { EVENT_CODE } from '../../utils/aria'
import { on, off } from '../../utils/dom'
const TypeMap: Indexable<string> = {
@ -137,8 +137,8 @@ export default defineComponent({
this.closed = true
this.timer = null
},
keydown({ keyCode }: KeyboardEvent) {
if (keyCode === eventKeys.esc) {
keydown({ code }: KeyboardEvent) {
if (code === EVENT_CODE.esc) {
// press esc to close the message
if (!this.closed) {
this.close()

View File

@ -33,6 +33,7 @@ export default defineComponent({
props: {
value: {
required: true,
type: [String, Number, Object],
},
label: [String, Number],
created: Boolean,
@ -42,7 +43,7 @@ export default defineComponent({
},
},
setup(props, ctx) {
setup(props) {
const states = reactive({
index: -1,
groupDisabled: false,
@ -57,7 +58,7 @@ export default defineComponent({
isDisabled,
select,
hoverItem,
} = useOption(props, states, ctx)
} = useOption(props, states)
const {
visible,

View File

@ -10,10 +10,10 @@ import {
selectEvents,
} from './token'
export function useOption(props, states, ctx) {
export function useOption(props, states) {
// inject
const select = inject(selectKey)
const selectGroup = inject(selectGroupKey, {})
const selectGroup = inject(selectGroupKey, { disabled: false })
// computed
const isObject = computed(() => {