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

推荐订阅源

F
Fortinet All Blogs
Attack and Defense Labs
Attack and Defense Labs
V2EX - 技术
V2EX - 技术
O
OpenAI News
S
Secure Thoughts
H
Heimdal Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Schneier on Security
Schneier on Security
H
Hacker News: Front Page
S
Security Affairs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
The Register - Security
The Register - Security
GbyAI
GbyAI
Cloudbric
Cloudbric
MongoDB | Blog
MongoDB | Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
Forbes - Security
Forbes - Security
Y
Y Combinator Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Scott Helme
Scott Helme
Hacker News - Newest:
Hacker News - Newest: "LLM"
The Cloudflare Blog
Recorded Future
Recorded Future
人人都是产品经理
人人都是产品经理
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
Webroot Blog
Webroot Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LangChain Blog
T
Tor Project blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
Hacker News: Ask HN
Hacker News: Ask HN
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
I
Intezer
V
V2EX
T
Tailwind CSS Blog
SecWiki News
SecWiki News
NISL@THU
NISL@THU
C
Check Point Blog

博客园 - 丁焕轩

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