小编Cha*_*haw的帖子

如何在 b-table 的 v-slot:cell() 模板中获取项目值 - BootstrapVue

我是一个非常新的编程。我试图弄清楚如何绑定数据以获取链接 :href 使用 store、vuex 和 bootstrap-vue 表工作。我为此花了 4 天时间,现在我快要死了。请帮忙。

book.js(商店,vuex)

books: [
    {
      id: 1,
      name: "name 1",
      bookTitle: "book1",
      thumbnail: '../../assets/img/book01.jpeg',
      url: "https://www.google.com",
      regDate: '2019-10'
    },
    {
       id: 2,
      name: "name2",
      bookTitle: "book2",
      thumbnail: "book2",
      url: "http://www.yahoo.com",
      regDate: '2019-10'
    },
Run Code Online (Sandbox Code Playgroud)

书单.vue

books: [
    {
      id: 1,
      name: "name 1",
      bookTitle: "book1",
      thumbnail: '../../assets/img/book01.jpeg',
      url: "https://www.google.com",
      regDate: '2019-10'
    },
    {
       id: 2,
      name: "name2",
      bookTitle: "book2",
      thumbnail: "book2",
      url: "http://www.yahoo.com",
      regDate: '2019-10'
    },
Run Code Online (Sandbox Code Playgroud)
<script>
export default {
  name: "BookList",
  components: …
Run Code Online (Sandbox Code Playgroud)

data-binding vue.js bootstrap-vue v-slot

6
推荐指数
1
解决办法
9946
查看次数

如何销毁或阻止mounted() vuejs 中的挂载事件

我正在制作一个包装组件,所以我需要在mounted() 方法中添加所有事件。然而事情是,因为它是另一个组件,每当我打开该组件时,都会触发事件。我不知道如何阻止它。即使我让它在单击组件时被触发,但它没有用。它仅适用于第一次安装。重新打开它(从第二个安装)后,它只会触发所有事件,我必须阻止它。

有没有一种方法可以阻止我不触发 vuejs 的mounted() 钩子中的事件?

编辑:我正在制作传单画包装。所有事件都来自传单绘制文档。

this.addnew() 是被触发的。

objectLayer.on("layeradd", (e) => {
        let layer = e.layer;
        layer.on("click", onClickFeatureSelct, layer);

    if (typeof layer.options.id === "undefined") {
      layer.options.id = L.Util.stamp(layer);
    }

    if (!layer.feature) {
      let json = layer.toGeoJSON();
      layer.feature = L.GeoJSON.asFeature(json);
    }

    let properties = layer.feature.properties;
    let keyvalue = L.stamp(layer);

    if (layer instanceof L.NodeCircle) {
      let latlng = layer.getLatLng();

      itemType = "node";

      let nodes = this.$store.getters.nodeList;

      let result = false;
      for (let i = 0; i < nodes.length; i++) {
        if …
Run Code Online (Sandbox Code Playgroud)

javascript lifecycle vue.js vue-component

5
推荐指数
1
解决办法
173
查看次数