任务是改变移动汽车的比例,已经通过地图构造函数添加。但是为此,您需要获得一张卡。
主页
/
user-310061
Alex's questions
地理对象通过 ObjectManager 添加到地图中,但是当您单击地图上的“在 Yandex.Maps 中打开”链接时,没有地理对象。无法弄清楚如何传递对象或在哪里查找信息
我试图找出一个简单的问题。访问 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;
有人能遇到吗?
我无法弄清楚为什么 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
}
}
})
底线是你需要在填充时在另一个组件中显示值,并在添加新输入时动态执行。
我不知道如何在通过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 正确地将数据响应式地输出到不同的模板。
也许有人遇到过。