当前位置:网站首页>MVVM model
MVVM model
2022-04-23 18:40:00 【_ ocean】
List of articles
meaning
- M: Model (Model) : Corresponding data Data in
- V: View (View): Templates , Corresponding to the page
- VM: Model view (ViewModel) : Vue Instance object
ViewModel abbreviation vm, It also corresponds to vue, therefore vue Objects created often use variable names vm receive .
eg:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Document</title>
<script src="../js/vue.js"></script>
</head>
<body>
<div id="root">
<h1> School name :{
{name}}</h1>
<h1> School address :{
{address}}</h1>
</div>
</body>
<script> Vue.config.productionTip = false; new Vue({
el:'#root', data:{
name:' Baidu ', address:' Beijing ' } }) </script>
</html>
analysis :
characteristic
1.data All the attributes in , Finally, it all appeared in vm On the body .—— Data brokers
eg:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Document</title>
<script src="../js/vue.js"></script>
</head>
<body>
<div id="root">
<h1> School name :{
{name}}</h1>
<h1> School address :{
{address}}</h1>
</div>
</body>
<script> Vue.config.productionTip = false; const vm = new Vue({
el:'#root', data:{
name:' Baidu ', address:' Beijing ' } }) console.log(vm); </script>
</html>
2.vm All the attributes and Vue All properties on the prototype , stay Vue Templates can be used directly .
eg:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Document</title>
<script src="../js/vue.js"></script>
</head>
<body>
<div id="root">
<h1> School name :{
{name}}</h1>
<h1> School address :{
{address}}</h1>
<h1> monitor :{
{$listeners}}</h1>
<h1>_hasHookEvent:{
{_hasHookEvent}}</h1>
</div>
</body>
<script> Vue.config.productionTip = false; const vm = new Vue({
el:'#root', data:{
name:' Baidu ', address:' Beijing ' } }) console.log(vm); </script>
</html>
Output :
版权声明
本文为[_ ocean]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231835268858.html
边栏推荐
- Interpretation and compilation of JVM
- Implementation of TCP UDP communication with golang language
- 14 py games source code share the second bullet
- Introduction to QT programming
- ctfshow-web361(SSTI)
- 14个py小游戏源代码分享第二弹
- Promote QT default control to custom control
- Analysez l'objet promise avec le noyau dur (Connaissez - vous les sept API communes obligatoires et les sept questions clés?)
- CISSP certified daily knowledge points (April 18, 2022)
- 使用 bitnami/postgresql-repmgr 镜像快速设置 PostgreSQL HA
猜你喜欢
STM32学习记录0008——GPIO那些事1
Chondroitin sulfate in vitreous
玻璃体中的硫酸软骨素
使用 bitnami/postgresql-repmgr 镜像快速设置 PostgreSQL HA
Résolution: cnpm: impossible de charger le fichier... Cnpm. PS1 parce que l'exécution de scripts est désactivée sur ce système
ESP32 LVGL8. 1 - input devices (input devices 18)
ctfshow-web361(SSTI)
Halo 开源项目学习(七):缓存机制
根据快递单号查询物流查询更新量
ESP32 LVGL8. 1 - img picture (IMG 20)
随机推荐
Spark performance optimization guide
ESP32 LVGL8. 1 - checkbox (checkbox 23)
Sentinel服务熔断实战(sentinel整合ribbon+openFeign+fallback)
Quantexa CDI(场景决策智能)Syneo平台介绍
Resolution: cnpm: unable to load file \cnpm. PS1, because running scripts is prohibited on this system
串口调试工具cutecom和minicom
Daily network security certification test questions (April 12, 2022)
22年字节跳动飞书人力套件三面面经
Interpretation and compilation of JVM
Implementation of TCP UDP communication with golang language
配置iptables
MVVM模型
Mysql database backup command -- mysqldump
Query the logistics update quantity according to the express order number
机器学习理论之(7):核函数 Kernels —— 一种帮助 SVM 实现非线性化决策边界的方式
Use stm32cube MX / stm32cube ide to generate FatFs code and operate SPI flash
Sentinel service fusing practice (sentinel integration ribbon + openfeign + fallback)
解决:cnpm : 无法加载文件 ...\cnpm.ps1,因为在此系统上禁止运行脚本
Daily network security certification test questions (April 14, 2022)
实战业务优化方案总结---主目录---持续更新