RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / user-310061

Alex's questions

Martin Hope
Alex
Asked: 2022-05-24 23:54:30 +0000 UTC

有没有办法让 Yandex 地图在地图构造函数中制作并显示在页面上

  • 1

任务是改变移动汽车的比例,已经通过地图构造函数添加。但是为此,您需要获得一张卡。

yandex-maps-api
  • 1 个回答
  • 10 Views
Martin Hope
Alex
Asked: 2022-05-23 22:32:09 +0000 UTC

地理对象通过 ObjectManager 添加到地图中,但是当您单击地图上的链接“在 Yandex.Maps 中打开”时,没有地理对象

  • 0

地理对象通过 ObjectManager 添加到地图中,但是当您单击地图上的“在 Yandex.Maps 中打开”链接时,没有地理对象。无法弄清楚如何传递对象或在哪里查找信息

яндекс
  • 1 个回答
  • 10 Views
Martin Hope
Alex
Asked: 2020-09-28 22:32:21 +0000 UTC

将数组写入字符串并将文件发送到 PHP 下载

  • 1

我试图找出一个简单的问题。访问 url 时,需要对数据进行排序,在输出处获取一个字符串,将其写入文件并发送以供下载。该数组由对数据库的查询形成,然后迭代。结果是这样的结构

foreach ($allRes as $row){
    foreach ($row as $k => $v){
        if($k != 'section_id')
        {

            $str.= $v . $col_delimiter. '  -  ' . $count;
        }
    }
    $count++;
    $str .= $row_delimiter;
}

结果是带有连字符的行

我做到了,一切正常,但并非所有行都进入下载的文件

 header('Content-Disposition: attachment; filename="str.txt"');
 header('Content-Type: text/plain'); 
 header('Content-Length: ' . strlen($str));
 header('Connection: close');
 echo $str;

有人能遇到吗?

php
  • 1 个回答
  • 10 Views
Martin Hope
Alex
Asked: 2020-09-27 15:19:10 +0000 UTC

使用多输入时存储条目

  • 0

我无法弄清楚为什么 set 不适用于计算属性。单击时添加了一个输入,创建了一个对象数组。写入特定输入后,值会进入本地组件,但不会进入存储区。

    <template>
    <div>
      <div class="deck__f">
        <div class="i_wrap" v-for="(val, i) in elem" :data-item="i">
          <input type="text" v-model="elem[i].title">
          <input type="text" v-model="elem[i].style">
          <input type="text" :value="i">
          <button @click="elemDel(i)">del {{i}}</button>  
        </div>
        <el-row>
          <el-button type="danger" icon="el-icon-plus" @click="drawElRawAdd">Add More</el-button>
        </el-row>
      </div>
    </div>

</template>
<script>
  import _ from 'lodash';    
  export default {
    data() {
      return {
        el:[]
      }
    },
    methods: {
      drawElRawAdd(){
        this.el.splice(this.el.length, this.el.length+1, {});
        this.$store.dispatch('drawElRawAdd', this.el);
      },
      elemDel(i){
        this.el.splice(i, 1)
        this.elemStore()
      },
      elemStore(){
        this.$store.dispatch('drawElRawAdd', this.el);
      },
    },
    computed:{
      elem:{
        get(){
          return this.el
        },
        set(value){
          this.el = value;
          this.elemStore()
        }
      },
    },
    components:{
      inputItem
    },

  }
  </script>

店铺

export default new Vuex.Store({
    state:{
        drawEl:[],
    },
    getters:{

    },
    actions:{
        drawElRawAdd(context, data){
            context.commit('drawElRawAdd', data)
        },
        drawElRawDel(context){
            context.commit('decriment', data)
        }
    },
    mutations:{
        drawElRawAdd(state, payload){
            state.drawEl = payload;
        },
        decriment(state, p){
            state.drawEl = p
        }
    }

})

底线是你需要在填充时在另一个组件中显示值,并在添加新输入时动态执行。

javascript
  • 1 个回答
  • 10 Views
Martin Hope
Alex
Asked: 2020-09-23 07:54:46 +0000 UTC

如何通过存储在 vuex 中以反应方式将数据输出到不同的模板

  • 0

我不知道如何在通过store填充一个组件中的输入时显示值对于另一个中的输出,现在我通过计算完成,一切正常,但只有在填充输入的模板中返回此属性. 有一个子组件,其中

<template>

 <input type="text" class="form-control" v-model="phone">
</template>
<script>
 export default {
  data(){
   return { 
        phone:''
     }
    },
   computed:{
     heroPhone(){
        this.$store.dispatch('setPhone',  this.phone)
        return this.$store.getters.getPhoneValue;
     },
   }

</script>

在 store.js 中

export default new Vuex.Store({
    state:{
        phoneValue: '',
    },
    getters:{
      getPhoneValue: state => { return state.phoneValue }
    },
    actions:{
      setPhone(context, data){
        context.commit('setPhone', data)
    },
    mutations:{
      setPhone(state, payLoad){
        state.phoneValue = payLoad
      },
    }
  })

因此,使用另一个组件,我尝试在计算属性中显示来自商店的 phoneValue 值,

 computed:{
        phone(){
          return this.$store.getters.getPhoneValue
        } 
      }

我通过 {{phone}} 输出属性本身。但是没有像这样显示,但只有在我捕获输入值的模板中才会显示

v-model="phone"

打印声明的计算属性 {{heroPhone}} 然后在其他模板中该值store.phoneValue显示正常。

我不知道如何通过 vuex 正确地将数据响应式地输出到不同的模板。

也许有人遇到过。

javascript
  • 1 个回答
  • 10 Views

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5