refactor(components): [divider] switch to script-setup (#6556)

Co-authored-by: rove <rove@outlook.com>
This commit is contained in:
wzrove 2022-03-12 21:31:24 +08:00 committed by GitHub
parent 525f61f8da
commit 0e6ff4f9a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,30 +9,20 @@
</div>
</template>
<script lang="ts">
import { defineComponent, computed } from 'vue'
<script lang="ts" setup>
import { computed } from 'vue'
import { useNamespace } from '@element-plus/hooks'
import { dividerProps } from './divider'
import type { CSSProperties } from 'vue'
export default defineComponent({
defineOptions({
name: 'ElDivider',
props: dividerProps,
setup(props) {
const ns = useNamespace('divider')
const dividerStyle = computed(() => {
})
const props = defineProps(dividerProps)
const ns = useNamespace('divider')
const dividerStyle = computed(() => {
return {
'--el-border-style': props.borderStyle,
} as CSSProperties
})
return {
ns,
dividerStyle,
}
},
})
</script>