UBB 组件

Ubb 组件

用于 ubb 与 html 标准转换

代码示例

>{}
<template>
  <div>
    <TextUbb
      v-model="the.body"
      placeholder="请输入ubb"
      rows="15"
      @onEvent="onEvent"
    />
  </div>
</template>

<script>
export default {
  setup(props, context) {
    // 使用外挂方式引入,具体查看demo
    const $plus = window.$plus;
    const { reactive } = $plus.vue;

    const the = reactive({
      body: '&lt;b&gt;123&lt;/b&gt;',
    });

    const onEvent = (resp) => {
      console.log('json', resp);
    };

    return { the, onEvent };
  },
};
</script>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

TextUbb Props

属性说明类型默认值
v-model双向绑定数据String-
disabled是否只读Booleanfalse
clearable是否显示清空按钮Booleanfalse
format 0.4.2初始内容是否格式化为 ubbBooleanfalse
named 0.4.2组件触发事件名称Stringubb

TextUbb onEvent

  • 点击转换时触发
参数名说明类型
cmdformat:格式化触发,error:错误触发,clear:清除String
named组件命名String
data转换之后的事件数据String
format是否格式化显示为 stringBoolean
event组件触发对象Boolean
messageerror 错误提示String

Last Updated: