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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { defineComponent, computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { useNamespace } from '@element-plus/hooks'
|
import { useNamespace } from '@element-plus/hooks'
|
||||||
|
|
||||||
import { dividerProps } from './divider'
|
import { dividerProps } from './divider'
|
||||||
import type { CSSProperties } from 'vue'
|
import type { CSSProperties } from 'vue'
|
||||||
|
|
||||||
export default defineComponent({
|
defineOptions({
|
||||||
name: 'ElDivider',
|
name: 'ElDivider',
|
||||||
props: dividerProps,
|
})
|
||||||
|
const props = defineProps(dividerProps)
|
||||||
setup(props) {
|
const ns = useNamespace('divider')
|
||||||
const ns = useNamespace('divider')
|
const dividerStyle = computed(() => {
|
||||||
|
return {
|
||||||
const dividerStyle = computed(() => {
|
'--el-border-style': props.borderStyle,
|
||||||
return {
|
} as CSSProperties
|
||||||
'--el-border-style': props.borderStyle,
|
|
||||||
} as CSSProperties
|
|
||||||
})
|
|
||||||
|
|
||||||
return {
|
|
||||||
ns,
|
|
||||||
dividerStyle,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user