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> </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>