1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- import baseComponent from '../helpers/baseComponent'
- import classNames from '../helpers/classNames'
- baseComponent({
- relations: {
- '../skeleton/index': {
- type: 'ancestor',
- },
- },
- properties: {
- prefixCls: {
- type: String,
- value: 'wux-skeleton-avatar',
- },
- size: {
- type: String,
- value: 'default',
- },
- shape: {
- type: String,
- value: 'circle',
- },
- },
- data: {
- active: false,
- },
- computed: {
- classes() {
- const { prefixCls, active, size, shape } = this.data
- const wrap = classNames(prefixCls, {
- [`${prefixCls}--active`]: active,
- [`${prefixCls}--${size}`]: size,
- [`${prefixCls}--${shape}`]: shape,
- })
- return {
- wrap,
- }
- },
- },
- methods: {
- updated(active) {
- if (this.data.active !== active) {
- this.setData({
- active,
- })
- }
- },
- },
- })
|