wolichuang / dailyInterview

面试、工作中遇到的issue
0 stars 0 forks source link

vue-antd 笔记 #51

Open wolichuang opened 3 years ago

wolichuang commented 3 years ago

JS过滤HTML标签

 var msg = msg.replace(/<\/?[^>]*>/g, ''); //去除HTML Tag
       msg = msg.replace(/[|]*\n/, '') //去除行尾空格
       msg = msg.replace(/&npsp;/ig, ''); //去掉npsp

table 插槽

<a-table>
<span slot="videoPreview" slot-scope="text, record, index">
                        <a
                          :href="record.videoPreview"
                        >
                          <img :src="record.videoPreview" alt="" width="80" height="80"/>
                        </a>
                      </span>
</a-table>
columns: [
{
              title: "预览图路径",
              dataIndex: "videoPreview",
              scopedSlots: { customRender: "videoPreview" },
},
]