Vue ④-组件通信 || 进阶语法
组件三大部分
template:只有能一个根元素
style:全局样式(默认):影响所有组件。局部样式:scoped
下样式,只作用于当前组件
script:el 根实例独有,data 是一个函数,其他配置项一致。
组件的样式冲突 scoped
默认情况:写在组件中的样式会 全局生效 → 因此很容易造成多个组件之间的样式冲突问题。
- 全局样式:默认组件中的样式会作用到全局
- 局部样式:可以给组件加上
scoped
属性,可以让样式只作用于当前组件。
scoped 原理
- 给当前组件模板的所有元素,都会添加上一个自定义属性
data-v-hash值
->data-v-5f6a9d56
用于区分开不通的组件。 - css选择器后面,被自动处理,添加上了属性选择器:
div[data-v-5f6a9d56]
div /*(div[data-v-5f6a9d56])*/ {border: 3px solid blue;margin: 30px;
}
data 是一个函数
一个组件的 data 选项必须是一个函数。→ 保证每个组件实例,维护独立的一份数据对象。
每次创建新的组件实例,都会新执行一次 data 函数,得到一个新对象。
// data() {
// console.log('函数执行了')
// return {
// count: 100,
// }
// },
data: function () {return {count: 100,}
}
组件通信
组件通信, 就是指 组件与组件 之间的数据传递。
- 组件的数据是独立的,无法直接访问其他组件的数据。
- 想用其他组件的数据 → 组件通信。
父子关系使用:props
和 $emit
非父子关系使用: provide
& inject
或 eventBus
通用的方式:Vuex(适合复杂业务场景)。
父子组件通信
- 父组件通过
props
将数据传递给子组件 - 子组件利用
$emit
通知父组件修改更新
父 -> 子
① 父中给子添加属性传值 ② 子 props
接收 ③ 子组件使用
父组件:
<template><div class="app">我是父组件<!-- 1.给组件标签,添加属性方式 赋值 --><Son :title="myTitle"></Son></div>
</template><script>
import Son from "./components/Son.vue"
export default {name: "App",components: {Son,},data() {return {myTitle: "学前端,就来程序员",}},
}
</script><style>
</style>
子组件:
<template><div class="son"><!-- 3.直接使用 props 的值 -->我是Son组件{{ title }}</div>
</template><script>
export default {name: 'Son-Child',// 2.通过props来接受props: ['title'],
}
</script><style>
</style>
子 -> 父
① 子 $emit
发送消息 ② 父中给子添加消息监听 ③ 父中实现处理函数
父组件:
<template><div class="app">我是APP组件<!-- 2.父组件,对消息进行监听 --><Son :title="myTitle" @changeTitle="handleChange"></Son></div>
</template><script>
import Son from "./components/Son.vue"
export default {name: "App",components: {Son,},data() {return {myTitle: "学前端,就来程序员",}},methods: {handleChange(newTitle) {this.myTitle = newTitle}}
}
</script><style>
</style>
子组件:
<template><div class="son">我是Son组件{{ title }}<button @click="changeFn">修改titile</button></div>
</template><script>
export default {name: 'Son-Child',props: ['title'],methods: {changeFn() {// 1.通过 $emit,向父组件发送消息通知this.$emit('changeTitle', '传智教育')}}
}
</script><style>
</style>
prop
Prop 定义:组件上 注册的一些 自定义属性
Prop 作用:向子组件传递数据
特点:
- 可以 传递 任意数量 的prop
- 可以 传递 任意类型 的prop
父组件:
<template><div class="app"><UserInfo:username="username":age="age":isSingle="isSingle":car="car":hobby="hobby"></UserInfo></div>
</template><script>
import UserInfo from './components/UserInfo.vue'
export default {data() {return {username: '小帅',age: 28,isSingle: true,car: {brand: '宝马',},hobby: ['篮球', '足球', '羽毛球'],}},components: {UserInfo,},
}
</script><style>
</style>
子组件:
<template><div class="userinfo"><h3>我是个人信息组件</h3><div>姓名:{{ username }} </div><div>年龄:{{ age }} </div><div>是否单身:{{ isSingle ? '是' : '否' }} </div><div>座驾:{{ car.brand }} </div><div>兴趣爱好 {{ hobby.join(', ') }} </div></div>
</template><script>
export default {props: ['username', 'age', 'isSingle', 'car', 'hobby']
}
</script><style>
</style>
props 校验
组件的 prop 可以乱传么?
为组件的 prop 指定验证要求,不符合要求,控制台就会有错误提示 → 帮助开发者,快速发现错误。
语法:
- 类型校验
- 非空校验
- 默认值
- 自定义校验
props: {校验的属性名: 类型 // Number String Boolean ...
},props: {校验的属性名: {type: 类型, // Number String Boolean ...required: true, // 是否必填default: 默认值, // 默认值validator (value) {// 自定义校验逻辑return 是否通过校验}}
},
父组件:
<template><div class="app"><BaseProgress :w="width"></BaseProgress></div>
</template><script>
import BaseProgress from './components/BaseProgress.vue'
export default {data() {return {width: 50,}},components: {BaseProgress,},
}
</script><style>
</style>
子组件:
<template><div class="base-progress"><div class="inner" :style="{ width: w + '%' }"><span>{{ w }}%</span></div></div>
</template><script>
export default {// props: ["w"],// 1.基础写法(类型校验)// props: {// w: Number// }// 2.完整写法(类型、是否必填、默认值、自定义校验)props: {w: {type: Number,// 是在父类使用组件时,看其是否用自定义属性绑定了require: true,default: 80,validator(value) {if(value >= 0 && value <= 100) {return true} else {console.error("错误")return false}}}}
}
</script><style>
</style>
prop & data、单向数据流
三者共同点:都可以给组件提供数据。
区别:
- data 的数据是自己的 → 随便改
- prop 的数据是外部的 → 不能直接改,要遵循 单向数据流
单向数据流:父级 prop 的数据更新,会向下流动,影响子组件。这个数据流动是单向的。
谁的数据谁负责
非父子通信 (拓展) - event bus 事件总线
作用:非父子组件之间,进行简易消息传递。(复杂场景 → Vuex)
- 创建一个都能访问到的事件总线 (空 Vue 实例) → utils/EventBus.js
import Vue from 'vue'
const Bus = new Vue()
export default Bus
- B 组件(发送方),触发 Bus 实例的事件
sendMsgFn () {Bus.$emit('sendMsg', '今天天气晴朗')
}
- A 组件(接收方),监听 Bus 实例的事件
created () {Bus.$on('sendMsg', (msg) => {this.msg = msg})
}
EveentBus.js
// 1. 创建一个都能访问到的事件总线(空的 Vue实例)
import Vue from 'vue'
const Bus = new Vue()
export default Bus
BaseA.vue:
<template><div class="base-a">我是A组件(接受方)<p>{{ msg }}</p> </div>
</template><script>
import Bus from '../utils/EventBus'
export default {created () {// 2. 在 A组件(接收方),进行监听 Bus 的事件(订阅事件)Bus.$on('sendMsg', (msg) => {this.msg = msg})}, data () {return {msg: ''}}
}
</script><style>
</style>
BaseB.vue:
<template><div class="base-b"><div>我是B组件(发布方)</div><button @click="sendMsgFn">发送消息</button></div>
</template><script>
import Bus from '../utils/EventBus'
export default {methods: {sendMsgFn () {// 3. 在 B组件(发送方)触发事件的方式传递参数(发布消息)Bus.$emit('sendMsg', '今天天气晴朗')}}
}
</script><style>
</style>
BaseC.vue:
<template><div class="base-c">我是C组件(接受方)<p>{{ msg }}</p> </div>
</template><script>
import Bus from '../utils/EventBus'
export default {created () {// 2. 在 A组件(接收方),进行监听 Bus的事件(订阅事件)Bus.$on('sendMsg', (msg) => {this.msg = msg})}, data () {return {msg: ''}}
}
</script><style>
</style>
非父子通信 (拓展) - provide & inject
provide & inject 作用:跨层级共享数据。
- 父组件 provide 提供数据
export default {provide () {return {color: this.color,userInfo: this.userInfo}},
}
- 子/孙组件 inject 取值使用
export default {inject: ['color', 'userInfo']
}
父组件:
<template><div class="app">我是APP组件<button @click="change">修改数据</button><SonA></SonA></div>
</template><script>
import SonA from './components/SonA.vue'
export default {provide () {return {color: this.color,userInfo: this.userInfo}},data() {return {color: 'pink', // 简单类型(非响应式)userInfo: { // 复杂类型(响应式)name: 'zs',age: 18,},}},methods: {change () {this.name = 'green',this.userInfo.name = 'ls',this.userInfo.age = 20}},components: {SonA,},
}
</script><style>
</style>
SonA.vue:
<template><div class="SonA">我是SonA组件<GrandSon></GrandSon></div>
</template><script>
import GrandSon from '../components/GrandSon.vue'
export default {components:{GrandSon}
}
</script><style>
</style>
GrandSon.vue:
<template><div class="GrandSon">我是GrandSon组件<div>颜色:{{ color }}</div><div>用户名:{{ userInfo.name }}</div><div>用户年龄:{{ userInfo.age }}</div></div>
</template><script>
import { provide, inject } from 'vue'
export default {inject: ['color', 'userInfo'],
}
</script><style>
</style>
进阶语法
v-model 原理
原理:v-model
本质上是一个语法糖。例如应用在输入框上,就是 value属性 和 input事件 的合写。
作用:提供数据的双向绑定
- 数据变,视图跟着变
:value
- 视图变,数据跟着变
@input
注意:$event
用于在模板中,获取事件的形参。
<template><div class="app"><input v-model="msg1" type="text" /><br /><!-- 模板中获取事件的形参 -> $event获取 --><input :value="msg2" @input="msg2 = $event.target.value" type="text" ></div>
</template><script>
export default {data() {return {msg1: '',msg2: ''}},
}
</script><style>
</style>
表单类组件封装
表单类组件 封装 -> 实现 子组件 和 父组件数据 的双向绑定。
- 父传子:数据 应该是父组件 props 传递 过来的,拆解 v-model 绑定数据
- 子传父:监听输入,子传父传值给父组件修改。
App.vue
<template><div class="app"><!-- 此处传递过来的是 e.target.value --><BaseSelect @changeId="selectId = $event" :cityId="selectId"></BaseSelect></div>
</template><script>
import BaseSelect from './components/BaseSelect.vue'
export default {data() {return {selectId: '104',}},components: {BaseSelect,},methods: {handleChange(e) {console.log(e);this.selectId = e}}
}
</script><style>
</style>
BaseSelect.vue
<template><div><select :value="cityId" @change="handleChange"><option value="101">北京</option><option value="102">上海</option></select></div>
</template><script>
export default {props: {cityId: String,},methods: {handleChange (e) {this.$emit('changeId', e.target.value)}}
}
</script><style>
</style>
可以直接使用 v-model
简化代码
App.vue
<template><div class="app"><!-- v-model => :value + @input --><BaseSelect v-model="selectId"></BaseSelect></div>
</template><script>
import BaseSelect from './components/BaseSelect.vue'
export default {data() {return {selectId: '103',}},components: {BaseSelect,},
}
</script><style>
</style>
BaseSelect.vue
<template><div><select :value="value" @change="handleChange"><option value="101">北京</option><option value="102">上海</option></select></div>
</template><script>
export default {props: {value: String,},methods: {handleChange (e) {this.$emit('input', e.target.value)}}
}
</script><style>
</style>
.sync 修饰符
作用: 可以实现 子组件 与 父组件数据 的 双向绑定,简化代码
特点: prop
属性名,可以自定义,非固定为 value
场景: 封装弹框类的基础组件, visible属性 true显示 false隐藏
本质: 就是 :属性名
和 @update:属性名
合写
<BaseDialog :visible.sync="isShow" />
--------------------------------------
<BaseDialog:visible="isShow"@update:visible="isShow = $event"
/>
props: {visible: Boolean
}close () {this.$emit('update:visible', false)
}
ref 和 $refs
作用: 利用 ref
和 $refs
可以用于 获取 dom 元素, 或 组件实例。
特点:查找范围 → 当前组件内 (更精确稳定)
获取 dom:
- 目标标签 - 添加 ref 属性
<div ref="dom"></div>
- 通过 this.$refs.xxx, 获取目标 dom 元素
mounted () {console.log(this.$refs.dom)
},
<div ref="mychart" class="box">子组件</div>
// 基于准备好的dom,初始化 echarts 实例
// const myChart = echarts.init(document.querySelector('.box'))
const myChart = echarts.init(this.$refs.mychart)
获取组件:
- 目标组件 – 添加 ref 属性
<BaseForm ref="baseForm"></BaseForm>
- 恰当时机, 通过 this.$refs.xxx, 获取目标组件,就可以调用组件对象里面的方法
this.$refs.baseForm.组件方法()
Vue异步更新、$nextTick
需求: 编辑标题, 编辑框自动聚焦
-
点击编辑,显示编辑框
-
让编辑框,立刻获取焦点
this.isShowEdit = true // 显示输入框
this.$refs.inp.focus() // 获取焦点
问题:“显示之后”,立刻获取焦点是不能成功的!
原因: Vue 是 异步更新 DOM (提升性能)
解决方案:
$nextTick
:等 DOM 更新后, 才会触发执行此方法里的函数体
语法: this.$nextTick(函数体)
this.$nextTick(() => {this.$refs.inp.focus()
})
<template><div class="app"><div v-if="isShowEdit"><input type="text" v-model="editValue" ref="inp" /><button>确认</button></div><div v-else><span>{{ title }}</span><button @click="handleEdit">编辑</button></div></div>
</template><script>
export default {data() {return {title: '大标题',isShowEdit: false,editValue: '',}},methods: {handleEdit () {this.isShowEdit = true// 等 Dom更新后,才会触发执行里面的方法体this.$nextTick(() => {this.$refs.inp.focus()})}},
}
</script><style>
</style>
ShowEdit = true // 显示输入框
this.$refs.inp.focus() // 获取焦点
问题:“显示之后”,立刻获取焦点是不能成功的!
原因: Vue 是 异步更新 DOM (提升性能)
解决方案:
$nextTick
:等 DOM 更新后, 才会触发执行此方法里的函数体
语法: this.$nextTick(函数体)
this.$nextTick(() => {this.$refs.inp.focus()
})
<template><div class="app"><div v-if="isShowEdit"><input type="text" v-model="editValue" ref="inp" /><button>确认</button></div><div v-else><span>{{ title }}</span><button @click="handleEdit">编辑</button></div></div>
</template><script>
export default {data() {return {title: '大标题',isShowEdit: false,editValue: '',}},methods: {handleEdit () {this.isShowEdit = true// 等 Dom更新后,才会触发执行里面的方法体this.$nextTick(() => {this.$refs.inp.focus()})}},
}
</script><style>
</style>
相关文章:

Vue ④-组件通信 || 进阶语法
组件三大部分 template:只有能一个根元素 style:全局样式(默认):影响所有组件。局部样式:scoped 下样式,只作用于当前组件 script:el 根实例独有,data 是一个函数,其他配置项一致…...
0x-2-Oracle Linux 9上安装JDK配置环境变量
一、JDK选择和使用 安装完Oracle Linux9.6,同时使用rpm包安装Oracle 23 ai free后, 将面临sqlcl程序无法使用和java无法使用,需要相应进行变量配置问题。 1、java 环境运行不存在,Oracle 23ai free安装后默认安装JDK 11 /opt/…...
深入理解卷积神经网络:从原理到应用
在人工智能领域,卷积神经网络(Convolutional Neural Network, CNN)无疑是计算机视觉领域的璀璨明珠。从 1998 年 Yann LeCun 提出 LeNet-5 实现手写数字识别,到 2012 年 AlexNet 在 ImageNet 大赛上创造历史性突破,CNN…...

从入门到实战:AI学习路线全解析——避坑指南
分享一下阿里的人工智能学习路线,为感兴趣系统学习的小伙伴们探路。 一、谁适合学这门AI课程?五类人群的精准定位 无论你是零基础小白还是职场转型者,这套系统化课程都能为你量身定制成长路径: 零基础爱好者(无编程/数学背景) 课程提供Python和数学前置学习建议,先补基…...
Spring Boot + Thymeleaf 防重复提交
在 Spring Boot 与 Thymeleaf 结合的 Web 应用中,防止重复提交可以采用token 机制 客户端禁用按钮的方式实现,在高并发场景下,考虑使用 Redis 存储 token 而非 Session。 第一步:后端实现 Controller public class FormControl…...

uniapp实现的简约美观的星级评分组件
采用 uniapp 实现的一款简约美观的星级评分模板,提供丝滑动画效果,用户可根据自身需求进行自定义修改、扩展,纯CSS、HTML实现,支持web、H5、微信小程序(其他小程序请自行测试) 可到插件市场下载尝试&#x…...

AWS Elastic Beanstalk + CodePipeline(Python Flask Web的国区CI/CD)
目标 需要使用AWS Elastic Beanstalk 部署一个Python的Flask Web应用,并且使用CodePipeline作为CI/CD工作流。 eb部署图 前提 假设你已经有一个能够正常运行的Python的Flask Web应用项目代码,而且需要对已有Flask工程做一些调整。由于AWS Elastic Bea…...

多线程语音识别工具
软件介绍 本文介绍一款支持大厂接口的语音转文字工具,具备免配置、免费使用的特点。 软件特性 该工具是一款完全免费的桌面端应用程序,部署于开源社区平台,其核心优势在于整合了多家技术供应商的接口资源。 操作方式 用户只需将音频…...
前端对WebSocket进行封装,并建立心跳监测
WebSocket的介绍: WebSocket 是一种在客户端和服务器之间进行全双工、双向通信的协议。它是基于 HTTP 协议,但通过升级(HTTP 升级请求)将连接转换为 WebSocket 协议,从而提供更高效的实时数据交换。 WebSocket 的特点…...

DiMTAIC 2024 数字医学技术及应用创新大赛-甲状腺B超静态及动态影像算法赛-参赛项目
参赛成绩 项目介绍 去年参加完这个比赛之后,整理了项目文件和代码,虽然比赛没有获奖,但是参赛过程中自己也很有收获,自己一个人搭建了完整的pipeline并基于此提交了多次提高成绩,现在把这个项目梳理成博客,…...

window安装docker\docker-compose
安装前配置 打开控制面板,参照下图打开“启动或关闭windows功能”,Hyper-V 和容器需要启用 程序和功能 启动或关闭windows功能 勾选Hyper-V 安装路径配置 Docker在Windows上的默认安装路径为C:\Program Files\Docker。 以管理员身份运行CMD在D盘,dev文件夹下创建Docker文…...

Jenkins的学习与使用(CI/CD)
文章目录 前言背景CI/CDJenkins简介Jenkins特性 安装Jenkins工作流程(仅供参考)安装maven和其他插件新建任务任务源码管理配置maven配置git(非必需) 尝试手动构建jar包可能遇到的错误 发布到远程服务器前置清理工作构建触发器git钩…...
vue-14(使用 ‘router.push‘ 和 ‘router.replace‘ 进行编程导航)
使用 ‘router.push’ 和 ‘router.replace’ 进行编程导航 编程导航是使用 Vue Router 构建动态和交互式 Web 应用程序的一个重要方面。它允许您根据应用程序逻辑、用户作或特定条件控制用户的导航流。您可以使用 router.push 和 router.replace 方法以编程方式导航到不同的路…...
使用WPF的Microsoft.Xaml.Behaviors.Wpf中通用 UI 元素事件
Nuget下载之后记得要先引用下面的 xmlns:i"http://schemas.microsoft.com/xaml/behaviors" <!-- 鼠标事件 --> <i:EventTrigger EventName"MouseEnter"/> <!-- 鼠标进入 --> <i:EventTrigger EventName"MouseLeave"/&g…...
Elasticsearch中的监控(Monitoring)功能介绍
Elasticsearch 的 监控(Monitoring) 功能用于实时跟踪集群的运行状态、性能指标和资源使用情况,帮助管理员及时发现潜在问题、优化配置并确保集群稳定高效运行。它通过内置工具和集成方案,提供从节点到集群、从硬件到服务层的全方…...

Centos7.6图文安装mysql8.4详细步骤记录
1 前提条件 1.1 关闭数据库服务器的防火墙 # 关闭数据库服务器的防火墙 systemctl stop firewalld systemctl disable firewalld 1.2 关闭SELinux # 编辑 /etc/selinux/configvi /etc/selinux/config#内容更改为disabledSELINUXdisabled 1.3 卸载系统自身带的mysql&#…...

AI短视频创富营
课程内容: 相关资料 【第一章】前期准备 001.【涨粉技巧】新账号如何快速涨粉?_ev(1).mp4 002.【带贷权限】如何开通账号带贷权限?(1).mp4 003.【费用缴纳】如何缴纳账号保证金?_ev(1).mp4 004.【账号检测】如何检测账号是否限流?(1).mp4 005.【风险规避…...
C++.OpenGL (4/64)纹理(Texture)
纹理(Texture) 纹理映射核心流程 #mermaid-svg-XxVbt4fizulzb5H3 {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-XxVbt4fizulzb5H3 .error-icon{fill:#552222;}#mermaid-svg-XxVbt4fizulzb5H3 .error-text{fill:…...

spring中的@RabbitListener注解详解
基本用法主要属性1. queues / queueNames2. containerFactory3. id4. concurrency5. ackMode6. priority7. bindings 高级特性1. 消息转换器2. 手动确认3. 条件监听4. 错误处理 配置监听容器工厂注意事项完整示例循环依赖解决1. 使用 Setter 注入2. 使用 Lazy 注解3. 重构代码结…...

MySQL-运维篇
运维篇 日志 错误日志 错误日志是 MySQL 中最重要的日志之一,它记录了当 mysqld 启动和停止时,以及服务器在运行过程中发生任何严重错误时的相关信息当数据库出现任何故障导致无法正常使用时,建议首先查看此日志。 该日志是默认开启的&am…...

深度优先算法学习
1: 从 1点出发到 15点 #include <stdio.h>#define MAX_NODES 100typedef struct {int node_id;int *nextNodes;int nextNodesSize; } Node;// 假设我们有一个节点数组,全局保存了所有节点 Node nodes[MAX_NODES];void dfs(int node_id) {Node *node &n…...
青少年编程与数学 01-011 系统软件简介 08 Windows操作系统
青少年编程与数学 01-011 系统软件简介 08 Windows操作系统 1. Windows操作系统的起源与发展1.1 早期版本(1985-1995)1.2 Windows 9x系列(1995-2000)1.3 Windows NT系列(1993-2001)1.4 Windows XP及以后版…...

前端技能包
ES6 <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><title>Title</title> </head> <body><script>// 变量定义var a1;let b5; // 现在使用let 定义变量// 对象解构let person{&quo…...
Vue-github 用户搜索案例
一、前言 在 Vue 开发中,与后端或第三方 API 接口进行交互是非常常见的需求。GitHub 提供了开放的 RESTful API,非常适合用来练习 Vue 的异步请求和数据绑定功能。 本文将带你一步步实现一个完整的 GitHub 用户搜索系统,包括: …...
Mac版Visual Studio Code Copilot 无法使用的解决方法
1 app文件夹删除Visual Studio Code 2 终端里面 输入以下指令,删除各种缓存 rm -fr ~/Library/Preferences/com.microsoft.VSCode.helper.plist rm -fr ~/Library/Preferences/com.microsoft.VSCode.plist rm -fr ~/Library/Caches/com.microsoft.VSCode rm -f…...

【笔记】PyCharm 使用问题反馈与官方进展速览
#工作记录 https://youtrack.jetbrains.com/issue/IJPL-190308 【笔记】记一次PyCharm的问题反馈_the polyglot context is using an implementation th-CSDN博客 【笔记】与PyCharm官方沟通解决开发环境问题-CSDN博客 与 JetBrains 官方沟通记录(PyCharm 相关问题…...

操作系统期末版
文章目录 概论处理机管理进程线程处理机调度生产者消费者问题 死锁简介死锁的四个必要条件解决死锁的方法 存储管理链接的三种方式静态链接装入时动态链接运行时链接 装入内存的三种方式绝对装入可重定位装入动态运行时装入 覆盖交换存储管理方式连续分配**分段存储管理方式***…...
本地主机部署开源企业云盘Seafile并实现外部访问
Seafile是一个开源、专业、可靠的云存储平台;解决文件集中存储、共享和跨平台访问等问题。这款软件功能强大,界面简洁、操作方便。 本文将详细的介绍如何利用本地主机部署 Seafile,并结合nat123,实现外网访问本地部署的 Seafile …...
微前端 - Native Federation使用完整示例
这是一个极简化的 Angular 使用angular-architects/native-federation 插件的微前端示例,只包含一个主应用和一个远程应用。 完整示例展示 项目结构 federation-simple/ ├── host-app/ # 主应用 └── remote-app/ # 远程应用 创建远程应用 (remote…...

自然语言处理——语言模型
语言模型 n元文法参数估计数据平滑方法加1法 神经网络模型提出原因前馈神经网络(FNN)循环神经网络 n元文法 大规模语料库的出现为自然语言统计处理方法的实现提供了可能,统计方法的成功应用推动了语料库语言学的发展。 语句 𝑠 …...