easy vue3 - 02 Data Binding v Model and v Bind

Vue 中有两种数据绑定方式: v-bind 单向绑定: 数据只能从 data 流向页面 v-model 双向绑定: 数据不仅能从 data 流向页面, 还可以从页面流向 data. v-model 一般用在 表单类型元素 上 (ex, input, select)。 v-model 需要省略 v-model:value 中的 value , 因为 v-model 默认收集的就是 value 值。 v-model:value 会提示错误: v-model argument is not supported on plain elements.vue(55) 1 2 3 4 5 6 7 8 9 10 11 <template> <h1>02 数据绑定 v-bind and v-model</h1> 1. v-bind 数据单……

阅读全文

easy vue3 - 01 模版语法

在 vue 中渲染变量通常有两种方式 插值语法, 又叫 胡子语法 , 使用 {{ xxx }} 方式在 标签体 渲染变量 1 <h3>插值语法: {{ name }}</h3> 指令语法 v-bind:attr="xxxx", v-bind 可以缩写为 冒号 :, attr 是 标签属性 名称; xxx 是属性标签值, 且 xxx 是 js 表达式 1 2 3 4 5 6 <h3>指令语法</h3> <a :href="url"> 百度一下 ( : ) </a>……

阅读全文

Gitlab 在不同 job 之间传递变量

在 gitlab 中, 不同 job 之间的变量是不能直接传递的。 但如果有需求, 则必须要借助 artifacts:reports:dotenv 实现。 在 job1 中保存在 script 下执行命令, 保存到 xxx.env 文件中。 将变量已 k=v 的形式保存 每行一个 不支持换行符 使用 artifacts:reports:dotenv 传递文件 在后续 job 中, 会自动加载 job1 传递 xxx.env 中的变量键值对。 另外如果在后续 job 中定义了同名变量,则这些变量值将被覆盖, 以 xxx.env 中……

阅读全文

《istio-in-action 系列》 1. 安装 docker-k3s-istio 开发环境

《istio-in-action 系列》 1. 安装 docker-k3s-istio 开发环境 1. 安装 docker 我这里使用的是 ubuntu20.04LTS 操作系统 1 2 sudo apt update sudo apt install docker-ce 配置 docker 加速仓库 1 2 3 4 5 6 7 { "registry-mirrors": [ "https://mirror.ccs.tencentyun.com", "https://wlzfs4t4.mirror.aliyuncs.com" ], "bip": "169.253.32.1/24" } 上述是腾讯云和阿里云的加速仓库, 根据需求自行调整。 完成配置后, 重启 docker 1 2 systemctl daemon-reload systemctl restart docker 2. 安装 k3s 2.1 安装 k3s k3s 使用 --docker 模式是为了方便 docker build 产生的……

阅读全文

《istio-in-action 系列》 1. 安装 docker-k3s-istio 开发环境

《istio-in-action系列》 1. 初始化第一个项目 项目代码在 https://github.com/tangx/istio-in-action 命令中有很多快捷键, 参考 install and prepare 1. 创建 namespace 并开启整体 istio 注入 这里已经使用了 alias 命令别名, 如果看不懂, 请参考第一篇 1.1 创建 namespace myistio 1 2 3 4 5 6 kc ns myistio namespace/myistio created kns myistio Context "default" modified. Active namespace is "myistio". 1.2 向 namespace 中开启 istio 注入 1 2 3 4 5 6 7 8 9 10 11 12 13 # 向 ns 加入标签……

阅读全文

《istio-in-action 系列》 1. 安装 docker-k3s-istio 开发环境

升级项目 之前的项目中只有 prod 服务,具有版本的区分。 现在对项目进行一些升级, 模拟一个多服务的项目。 两个服务, review / prod 服务之前还有调用关系。 prod -> review review 这次新加入了 review 评论服务。 { "1": { "id": "1", "name": "zhangsan", "commment": "istio 功能很强大, 就是配置太麻烦" }, "2": { "id": "1", "name": "wangwu", "commment": "《istio in action》 真是一本……

阅读全文

《istio-in-action 系列》 10. VirtualService 路由重定向

VirtualService 路由重定向 在 VirtualService 配置中, 除了 http rewrite 路由重写之外, 还有 http redirect 路由重定向。 即常说的 30x。 https://istio.io/latest/docs/reference/config/networking/virtual-service/#HTTPRedirect http redirect VirtualService 重定向配置如下。 有三个重要参数 uri: 重定向后的 uri redirectCode: 重定向时的 http response code。 ex: 301, 302。 默认值为 301 。 authority: 重定向后的 http host。 即 http response header 中的 location 字段。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 --- apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata:……

阅读全文

《istio-in-action 系列》 11. VirtualService 重试机制

VirtualService 重试机制 在 Istio VirtualService 中, 有一个很关键的机制: 重试。 发起重试不需要业务本身实现, 而是 istio 通过 envoy 发起的。 其中有几个关键参数 attempts: 重试次数(不含初始请求), 即最大请求次数为 n+1。 perTryTimeout: 发起重试的间隔时间。 必须大于 1ms。 默认于 http route 中的 timeout 一致, 即无 timeout 时间 retryOn: 执行重试的触发条件。 条件值有 envoy 提供: https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/router_filter#x-envoy-retry-on http retry 1……

阅读全文

福利派送

  • (免费星球)「运维成长路线」

  • 又拍云免费 CDN

最近文章

分类

标签

其它