mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-21 01:02:59 +08:00
refactor(components): [divider] switch to script-setup (#6556)
Co-authored-by: rove <rove@outlook.com>
This commit is contained in:
parent
525f61f8da
commit
0e6ff4f9a9
@ -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(() => {
|
||||
return {
|
||||
'--el-border-style': props.borderStyle,
|
||||
} as CSSProperties
|
||||
})
|
||||
|
||||
return {
|
||||
ns,
|
||||
dividerStyle,
|
||||
}
|
||||
},
|
||||
})
|
||||
const props = defineProps(dividerProps)
|
||||
const ns = useNamespace('divider')
|
||||
const dividerStyle = computed(() => {
|
||||
return {
|
||||
'--el-border-style': props.borderStyle,
|
||||
} as CSSProperties
|
||||
})
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user