我正在使用Bootstrap Vue,并希望使用格式化程序回调将html插入到表中的列中。Bootstrap文档示例将链接格式化为锚链接Ex。https://bootstrap-vue.js.org/docs/components/table/#shirley-partridge
    <b-table striped responsive hover :items="episodes" :fields="fields">
           <template v-slot:cell(version)="data">
        <a :href="`${data.value.replace(/[^a-z]+/i,'-').toLowerCase()}`">{{ data.value }}</a>
      </template>
    </b-table>我正在从版本属性中拉入一个完整的url,并且只想在模板中使用这个url,如何使用格式化程序删除我的url之前的所有内容?
    this.episodes = response.map((item) => {
          return {
            category: item.fields.title,
            episode_name: item.fields.splash,
            episode_acronym: item.fields.description,
            version: 'https://myurl/webinars' + item.fields.slug + '/' +'test',
          }
        })所需的链接将是https://myurl/webinars...
发布于 2020-01-10 00:36:21
通过保留相对的url格式,并使用-而不是+号更新格式化程序,我能够使其正常工作。
        <a :href="`${data.value.replace(/[^a-z]-/i,'-').toLowerCase()}`">Definition</a>https://stackoverflow.com/questions/59654046
复制相似问题