惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
W
WeLiveSecurity
IT之家
IT之家
A
About on SuperTechFans
B
Blog
L
LangChain Blog
H
Help Net Security
Engineering at Meta
Engineering at Meta
Recent Announcements
Recent Announcements
Google Online Security Blog
Google Online Security Blog
宝玉的分享
宝玉的分享
MyScale Blog
MyScale Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
N
News and Events Feed by Topic
Schneier on Security
Schneier on Security
GbyAI
GbyAI
博客园 - 叶小钗
人人都是产品经理
人人都是产品经理
S
SegmentFault 最新的问题
Cloudbric
Cloudbric
WordPress大学
WordPress大学
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Y
Y Combinator Blog
S
Security Affairs
The Last Watchdog
The Last Watchdog
H
Heimdal Security Blog
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
博客园 - 聂微东
H
Hackread – Cybersecurity News, Data Breaches, AI and More
P
Privacy & Cybersecurity Law Blog
V
Visual Studio Blog
H
Hacker News: Front Page
Recorded Future
Recorded Future
Cyberwarzone
Cyberwarzone
L
Lohrmann on Cybersecurity
Simon Willison's Weblog
Simon Willison's Weblog
P
Privacy International News Feed
博客园 - 三生石上(FineUI控件)
大猫的无限游戏
大猫的无限游戏
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Blog — PlanetScale
Blog — PlanetScale
G
Google Developers Blog
aimingoo的专栏
aimingoo的专栏
C
Cybersecurity and Infrastructure Security Agency CISA
AWS News Blog
AWS News Blog
Jina AI
Jina AI
N
News | PayPal Newsroom
S
Schneier on Security

博客园 - 丁焕轩

The SSL connection could not be established, see inner exception 错误 腾讯企业邮箱管理 万能五笔彻底删除,广告 C# 直接赋值 和 深拷贝 iis部署 访问 LINUX 基础 服务器无法从本地复制文件 修改引用api地图的样式,地图 程序用一段时间卡死、系统日志调试 博文阅读密码验证 - 博客园 sql server 常规问题 sql server 使用 博文阅读密码验证 - 博客园 utc时间戳 日期 转换 框架问题排查 FreeSql 使用说明 oracle 最简单连接 .net 增加 Swagger 解决跨域 oracle 服务器 客户端安装,配置
elemenet 级联
丁焕轩 · 2024-07-08 · via 博客园 - 丁焕轩

两种数据格式

注释掉的是一种格式,未注释的是另一种格式。

<template>
    <div>
      <!-- <select v-model="selectedProvince" @change="provinceChanged">
        <option v-for="province in provinces" :value="province.code">{{ province.name }}</option>
      </select> -->
      <select v-model="selectedProvince" @change="provinceChanged">
      <option v-for="province in provinces" :value="province">{{ province }}</option>
    </select>
      <select v-model="selectedCity">
        <option v-for="city in cities" :value="city">{{ city }}</option>
      </select>
    </div>
</template>
   
  <script>
  export default {
    data() {
      return {
        // provinces: [{code:'s001',name:'省份A'}, {code:'s002',name:'省份B'},{code:'s003',name:'省份C'}],
        // citiesMap: {
        //   's001': ['城市A1', '城市A2', '城市A3'],
        //   's002': ['城市B1', '城市B2', '城市B3'],
        //   's003': ['城市C1', '城市C2', '城市C3']
        // },
        provinces: ['省份A', '省份B', '省份C'],
        citiesMap: {
          '省份A': ['城市A1', '城市A2', '城市A3'],
          '省份B': ['城市B1', '城市B2', '城市B3'],
          '省份C': ['城市C1', '城市C2', '城市C3']
        },
        selectedProvince: '',
        selectedCity: ''
      };
    },
    computed: {
      cities() {
        return this.citiesMap[this.selectedProvince] || [];
      }
    },
    methods: {
      provinceChanged() {
        this.selectedCity = this.cities[0] || '';
      }
    },
    mounted() {
      this.provinceChanged(); // 初始化城市列表
    }
  };
  </script>

View Code