mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 02:31:21 +00:00
[Improvement] more component use bem mixin (#924)
This commit is contained in:
@@ -5,13 +5,17 @@
|
||||
@touchmove="onBlur"
|
||||
@touchend="onBlur"
|
||||
@touchcancel="onBlur"
|
||||
class="van-hairline van-key"
|
||||
:class="className"
|
||||
class="van-hairline"
|
||||
:class="[b(), className]"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
import create from '../utils/create';
|
||||
|
||||
export default create({
|
||||
name: 'key',
|
||||
|
||||
props: {
|
||||
text: [String, Number],
|
||||
type: {
|
||||
@@ -31,7 +35,7 @@ export default {
|
||||
const types = this.type.slice(0);
|
||||
this.active && types.push('active');
|
||||
|
||||
return types.map(type => `van-key--${type}`);
|
||||
return types.map(type => this.b([type]));
|
||||
}
|
||||
},
|
||||
|
||||
@@ -45,5 +49,5 @@ export default {
|
||||
this.active = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user