Vue Breakpoint Component(断点组件)
made with
Vuejs
简介及使用教程
Vue Breakpoint Component是一个用于组成CSS断点的无渲染组件。默认断点是基于Bootstrap 4,但是也可以定义无限数量的断点。
安装
Npm
npm i vue-breakpoint-component
Yarn
yarn add vue-breakpoint-component
使用
import { VBreakpoint } from 'vue-breakpoint-component'
export default {
components: {
VBreakpoint
}
}
示例
<v-breakpoint>
<div slot-scope="scope">
<span v-if="scope.isSmall" style="font-size: 2rem"> ???? </span>
<span v-if="scope.isMedium" style="font-size: 4rem"> ???? </span>
<span v-if="scope.isLarge" style="font-size: 6rem"> ???? </span>
<span v-if="scope.isXlarge" style="font-size: 8rem"> ???? </span>
<span v-if="scope.noMatch" style="font-size: 10rem"> ???? </span>
</div>
</v-breakpoint>
作者
Adi Sahar
相关项目