- 使用popup封装
- 可以使用js调用
use
component :
import jRule from 'jeft-vue/components/rule'
plugin :
immport { Rule } from 'jeft-vue'
Vue.use(Rule)
this.$rule(options)
props
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| name | string | 规则 | 弹窗标题 |
| content | string | 说明内容 | 可为富文本或者一段文字(已做xss处理) |
| height | string | '75vh' | 弹窗高度 |
| xssOptions | Object | xss过滤规则 | {} |
| safe-area-inset-bottom | boolean | true | popup属性 - 安全底部 |
| closeOnPopstate | boolean | true | popup属性 - 页面返回关闭弹窗 |
| tips: popup属性皆可传递 |
demo1 - plugin方式
<j-button :style="{ marginBottom: '15px' }" @click="showRule" round
>显示说明</j-button>
methods: {
showRule() {
this.$rule({
name: "说明",
content: "1...,<br />2...",
// popup参数
round: true,
});
},
},
demo2 - component
<j-rule v-model="show" name="说明" height="75vh"> 这是详细内容... </j-rule>
<j-button :style="{ marginBottom: '15px' }" @click="show = true" round
>显示说明-组件方式调用2</j-button
>
data() {
return {
show: false,
};
},