jeft-rule规则弹出窗

201 阅读1分钟

文档与演示

image.png

  • 使用popup封装
  • 可以使用js调用

插件地址-jeft-vue

use

component :
import jRule from 'jeft-vue/components/rule'

plugin :
immport { Rule } from 'jeft-vue'
Vue.use(Rule)

this.$rule(options)

props

参数类型默认值描述
namestring规则弹窗标题
contentstring说明内容可为富文本或者一段文字(已做xss处理)
heightstring'75vh'弹窗高度
xssOptionsObjectxss过滤规则{}
safe-area-inset-bottombooleantruepopup属性 - 安全底部
closeOnPopstatebooleantruepopup属性 - 页面返回关闭弹窗
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,
    };
  },