javascript - 为 bootstrap nuxt、js vue.js 重建动态菜单
问题描述
为 bootstrap nuxt、js vue.js 重建动态菜单
<template>
<div>
<br />
<b-container fluid="md">
<div class="mt-3" align="right">
choose kind : <strong>{{chtra.options.filter(val => val.value == chtra.selected)[0].text}}</strong>
</div>
<br />
<b-form-select
@input="searchSubGroup"
v-model="chtra.selected"
:options="chtra.options"
value-field="value"
text-field="text"
class="mt-3"
></b-form-select>
<br />
<div>
<br />
<b-form inline>
<div class="mr-auto ml-auto">
<div class="mt-3" align="right">
aaa: <strong>{{ chdays.selected }}</strong>
</div>
<b-form-select
v-model="chdays.selected"
:options="chdays.options"
></b-form-select>
</div>
<div class="mr-auto ml-auto">
<div class="mt-3" align="right" keep-alive>
bbb: <strong>{{ chmo.selected }}</strong>
</div>
<b-form-select
v-model="chmo.selected"
:options="chmo.options"
></b-form-select>
</div>
</b-form>
</div>
<br />
<div>
<b-button variant="primary" block>dooo</b-button>
</div>
</b-container>
</div>
</template>
<script>
import cmd from '@/static/cmd.json'
function changemonthes(value) {
return cmd.mounthes[value];
}
export default {
name: "index",
methods: {
searchSubGroup(value) {
xxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxx
},
},
data() {
console.log("data--------")
return {
chmo: cmd.mounthes.galali,
chtra: {
selected: "galali",
options: [{
value: "bbbbbbbbbbbbbb",
text: " bbbbbbbbbbbbbbb",
},
{
value: "cccccccccccccccccccccccc",
text: "ccccccccccccccccccccccc",
},
{
value: "ddddddddddddddddddddddd",
text: "ddddddddddddddddddddddd",
},
],
},
chdays: cmd.days,
};
},
};
</script>
这是 cmd.json 的 -e 包含
{
"mml" :{
"galali": {
"selected": "please choose",
"options": [
{ "value": "please choose", "text": "please choose", "disabled": true },
{
"value": { "txt": "ff", "exparam": "1" },
"text": "ff"
},
{
"value": { "txt": "oo", "exparam": "2" },
"text": "oo"
}
]
},
"ggr": {
"selected": "please choose",
"options": [
{ "value": "please choose", "text": "please choose", "disabled": true },
{
"value": { "txt": "jj", "exparam": "1" },
"text": "jj"
},
{
"value": { "txt": "ff", "exparam": "2" },
"text": "ff"
}
]
},
"arr": {
"selected": "please choose",
"options": [
{ "value": "please choose", "text": "please choose", "disabled": true },
{
"value": { "txt": "mm", "exparam": "1" },
"text": "mm"
},
{
"value": { "txt": "mm", "exparam": "2" },
"text": "mm"
}
]
}
},
"dda" : {
"selected": "please choose",
"options": [
{ "value": " please choose", "text": " please choose", "disabled": true },
{
"value": "1",
"text": " 1"
},
{
"value": "2",
"text": "2"
},
{
"value": "3",
"text": "3"
}
]
}
}
问题是我想更改“bbb”的包含或使用另一个单词 chmo.selected 通过选择“选择种类:”这意味着我将拥有动态菜单我在 xxxxxxxxxxxxxxxxxxxxxxxx 写的地方有什么变化或如何我再次回忆 data() 函数。
解决方案
推荐阅读
- azure - 在使用完全限定名称之前,AKS、Windows 节点、dns 不会解析服务
- css - 文本之间的空格
- r - 在 R 中的 plot_ly (plotly) 中获取 ylim
- python - 具有特定 dtypes 的 Pandas dataframe.to_numpy()
- python - 带有列表条目熊猫数据框的数据透视表
- python - 如何在 Django ORM 中获取常量列?
- javascript - 如何访问超出其承诺的信息
- javascript - 如何获取上一个日期期间
- android - Android sourceSets 有没有办法使用嵌套风味结构?
- leaflet - 搜索特定名称 onEachFeature