rich-text.uvue 1.1 KB
Newer Older
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
1 2
<template>
  <view>
W
微调  
wanganxp 已提交
3
    <page-head title="rich-text"></page-head>
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
4 5
    <view class="uni-padding-wrap uni-common-mt">
      <view class="uni-btn-v">
W
微调  
wanganxp 已提交
6 7 8
        <navigator url="/pages/component/rich-text/rich-text-tags">
          <button type="primary">rich-text渲染单个HTML标签示例</button>
        </navigator>
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
9 10
      </view>
      <view class="uni-btn-v">
W
微调  
wanganxp 已提交
11
        <navigator url="/pages/component/rich-text/rich-text-complex">
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
12
          <button type="primary">rich-text渲染复杂HTML示例</button>
W
微调  
wanganxp 已提交
13
        </navigator>
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
14
      </view>
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
15 16 17
      <view class="uni-title">
        <text class="uni-subtitle-text">selectable</text>
      </view>
18
      <view class="text-box" @click="testClick">
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
19 20 21
        <rich-text :selectable="true"
          nodes="<span>hello uni-app x!</span><br/><span>uni-app x,终极跨平台方案</span>"></rich-text>
      </view>
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
22 23 24 25 26
    </view>
  </view>
</template>

<script>
27 28 29 30 31 32 33 34
  export default {
    methods: {
      testClick() {
        // 测试点击rich-text是否正常触发父节点点击事件
        console.log('testClick')
      }
    },
  }
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
35 36 37
</script>

<style>
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
38
  .text-box {
H
hdx 已提交
39
    padding: 20px 0;
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
40 41
    background-color: white;
  }
H
hdx 已提交
42
</style>