Skip to content

Commit

Permalink
修复弹窗阴影问题
Browse files Browse the repository at this point in the history
  • Loading branch information
motao314 committed Aug 21, 2020
2 parents 8aae666 + 09541ab commit 37a59b7
Show file tree
Hide file tree
Showing 28 changed files with 924 additions and 648 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
- name: Install modules
run: yarn
- name: Run tests
run: yarn test:unit

68 changes: 68 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,74 @@ Scan the QR code using [Dingtalk App](https://www.dingtalk.com/) to join in disc
<img alt="Join Discusion Group" src="https://pic4.zhimg.com/80/v2-73947edcba4cbfe52cd779a3b1b974b5_1440w.png" width="300">


### basic
- [x] layout
- [x] container
- [x] color
- [x] typography
- [x] border
- [x] icon
- [x] button
- [x] link

### form
- [x] radio
- [ ] checkbox
- [ ] input
- [ ] inputNumber
- [ ] select
- [ ] cascader
- [ ] switch
- [ ] slider
- [ ] timePicker
- [ ] timePicker
- [ ] datePicker
- [ ] dateTimePicker
- [ ] Upload
- [x] Rate
- [ ] ColorPicker
- [ ] Transfer
- [ ] Form

### data
- [ ] Table
- [ ] Tag
- [ ] Progress
- [ ] Tree
- [ ] Pagination
- [x] Badge
- [x] Avatar

### Notice
- [ ] Alert
- [ ] Loading
- [ ] Message
- [ ] MessageBox
- [ ] Notification

### Navigation
- [ ] Navmenu
- [ ] Tabs
- [ ] Breadcrumb
- [ ] dropdown
- [ ] steps


### other
- [ ] dialog
- [ ] tooltip
- [ ] popover
- [ ] popoconfirm
- [ ] Card
- [ ] Carousel
- [ ] Collapse
- [ ] Timeline
- [ ] divider
- [ ] Calendar
- [ ] image
- [ ] backtop
- [ ] infiniteScroll
- [ ] drawer
<p align="center">
<img src="https://cdn.rawgit.com/ElemeFE/element/dev/element_logo.svg">
</p>
Expand Down
4 changes: 3 additions & 1 deletion build/bin/build-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ ComponentNames.forEach(name => {
'breadcrumb-item',
'dialog',
'rate',
'divider'
'divider',
'progress'

].indexOf(name) > -1) { // 白名单 挨个替换
var componentName = uppercamelcase(name)

Expand Down
2 changes: 1 addition & 1 deletion migrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
| Progress 进度条 || |
| Tree 树形控件 || |
| Pagination 分页 || |
| Badge 标记 | | |
| Badge 标记 | | |
| Avatar 头像 || |
| Alert 警告 || |
| Loading 加载 || |
Expand Down
20 changes: 10 additions & 10 deletions packages/badge/src/main.vue → packages/badge/Badge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</template>

<script>
import {computed, toRefs} from 'vue';
import {computed, toRefs} from 'vue'
export default {
name: 'ElBadge',
Expand All @@ -32,14 +32,14 @@ export default {
type: {
type: String,
validator(val) {
return ['primary', 'success', 'warning', 'info', 'danger'].indexOf(val) > -1;
return ['primary', 'success', 'warning', 'info', 'danger'].indexOf(val) > -1
}
}
},
setup (props) {
const {isDot, max, value} = toRefs(props);
const content = useContent(isDot, max, value);
setup(props) {
const {isDot, max, value} = toRefs(props)
const content = useContent(isDot, max, value)
return {
content
Expand All @@ -49,15 +49,15 @@ export default {
const useContent = (isDot, max, value) => {
const content = computed(() => {
if (isDot.value) return;
if (isDot.value) return
if (max && typeof value.value === 'number' && typeof max.value === 'number') {
return max.value < value.value ? `${max.value}+` : value.value;
return max.value < value.value ? `${max.value}+` : value.value
}
return value.value;
});
return value.value
})
return content;
return content
}
</script>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Badge from '../../../packages/badge/src/main.vue'
import Badge from '../Badge.vue'
import { mount } from '@vue/test-utils'
import '@testing-library/jest-dom'
describe('Badge', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/badge/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Badge from './src/main'
import Badge from './Badge.vue'

/* istanbul ignore next */
Badge.install = function(app) {
Expand Down
2 changes: 1 addition & 1 deletion packages/button/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default {
round: Boolean,
circle: Boolean
},
emits: ['click'],
setup(props, ctx) {
const { size, disabled } = toRefs(props)
Expand Down
24 changes: 24 additions & 0 deletions packages/button/__tests__/Button.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,30 @@ describe('Button.vue', () => {
wrapper.trigger('click')

expect(wrapper.emitted('click')).toBeTruthy()
expect(wrapper.emitted('click').length).toBe(1)
})

it('should only will trigger a click event', async() => {
let count = 0
const Comp = {
template: '<div><el-button @click="handleClick"></el-button></div>',
setup() {
const handleClick = ()=> count++
return { handleClick }
}
}

const wrapper = mount(Comp, {
global: {
components: {
'el-button': Button
}
}
})

await wrapper.findComponent({name: 'ElButton'}).trigger('click')

expect(count).toBe(1)
})

it("can't captures click events emitted via click when loading ", () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/dialog/Dialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import {
export default {
name: "ElDialog",
props: {
...popupProps,
title: {
type: String,
default: "",
Expand Down Expand Up @@ -105,8 +106,7 @@ export default {
type: Boolean,
default: false,
},
destroyOnClose: Boolean,
...popupProps,
destroyOnClose: Boolean
},
emits: ["update:visible", "close", "opened","open","closed"],
setup(props, { emit, slots }) {
Expand Down
2 changes: 1 addition & 1 deletion packages/link/src/main.vue → packages/link/Link.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ export default {
}
}
}
</script>
</script>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils'
import Link from '../../../packages/link/src/main.vue'
import Link from '../Link.vue'
describe('Link', () => {
describe('props', () => {
it('type', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/link/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Link from './src/main'
import Link from './Link.vue'

/* istanbul ignore next */
Link.install = function(app) {
Expand Down
Loading

0 comments on commit 37a59b7

Please sign in to comment.