create account

Vue用法的城市化比喻 / 网络研习社#39 by lemooljiang

View this thread on: hive.blogpeakd.comecency.com
· @lemooljiang ·
$7.63
Vue用法的城市化比喻 / 网络研习社#39
![vue-city.jpg](https://cdn.steemitimages.com/DQmf66mcusHGKFi5o4LNeu6oxb3kYmdNEBBo9U4ymA5Ab68/vue-city.jpg)

App.vue是Vue生成的挂载在index上的实例,它是作为一个根容器,所有的页面都会渲染成一个页面(SPA)。用到现在,突然有点联想,这其实和一个城市的运作是何其的相似!

在上图中,大家可以感受下这个形象地比喻:都是一个独一无二的实例,都是分区治理,都有相似的理念和治理方法。比如下面这种一一对应的关系:
```
#App => 广州市
各个组件 => 分布的区域
div等节点 => 市民
data => 数据中心
methods => 行政中心
v-model => 绑定银行卡
this => 市长印章
```

这种对应还有更多地想像余地,关键是通过这种比喻可以形象地理解Vue的很多设计思想。

现在很多新的语言(比如python , golang),还有一些设计框架,都是在原有的基础上封装了对象的概念,这样就有更好的设计性和更好的理解性,因为人们就是这样理解世界的。而语言又是描述世界的工具,还原世界的面貌。所以,如果语言和世界有更好的相似性和想通性,就能更好地促进彼此地理解。

得益于最近学习Vue的一些心得,想到了一些形象化的比喻,我觉得还不错。后面还将有一些图示,明天补上。
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
👎  , ,
properties (23)
authorlemooljiang
permlinkvue-39
categorycn
json_metadata{"tags":["cn","network-institute","vue","spa","this"],"image":["https://cdn.steemitimages.com/DQmf66mcusHGKFi5o4LNeu6oxb3kYmdNEBBo9U4ymA5Ab68/vue-city.jpg"],"app":"steemit/0.1","format":"markdown"}
created2019-10-09 12:54:15
last_update2019-10-09 12:54:15
depth0
children4
last_payout2019-10-16 12:54:15
cashout_time1969-12-31 23:59:59
total_payout_value3.849 HBD
curator_payout_value3.783 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length610
author_reputation437,786,961,471,535
root_title"Vue用法的城市化比喻 / 网络研习社#39"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id91,381,357
net_rshares24,242,097,932,922
author_curate_reward""
vote details (44)
@dailychina ·
$0.05
!thumbup
  恭喜你!您的这篇文章入选 @justyy 今日 (2019-10-11) 榜单 [【优秀的文章】](https://steemit.com/cn/@justyy/--daily-cn-updates-cncnpower-downyy2019-10-11), 回复本条评论24小时内领赏,点赞本评论将支持 @dailychina 并增加将来您的奖赏。
 @justyy 是CN区的见证人,[请支持他,给他投票](https://steemconnect.com/sign/account_witness_vote?approve=1&witness=justyy),或者设置justyy为[见证人代理](https://v2.steemconnect.com/sign/account-witness-proxy?proxy=justyy&approve=1)。感谢!@justyy的主要贡献:https://steemyy.com

Congratulations! This post has been selected by @justyy as today's (2019-10-11)  [【Good Posts】](https://steemit.com/cn/@justyy/--daily-cn-updates-cncnpower-downyy2019-10-11), Steem On!  Reply to this message in 24 hours to get rewards. Upvote this comment to support the @dailychina and increase your future rewards! ^_^

[SteemIt 工具、API接口、机器人和教程](https://steemyy.com/steemit-tools/)
[SteemIt Tools, Bots, APIs and Tutorial](https://SteemYY.com)<hr>
If you believe what I am doing, please consider a spare vote voting me [here](https://steemconnect.com/sign/account_witness_vote?approve=1&witness=justyy), thank you very much indeed.

@justyy - the author of https://SteemYY.com and I have been a Steem Witness for [more than a year now.](https://steemit.com/witness-category/@justyy/one-year-winessversary-a-great-start)
👍  , , , , , , , , , , ,
properties (23)
authordailychina
permlinkre-vue-39-20191011t080202
categorycn
json_metadata""
created2019-10-11 08:02:03
last_update2019-10-11 08:02:03
depth1
children0
last_payout2019-10-18 08:02:03
cashout_time1969-12-31 23:59:59
total_payout_value0.023 HBD
curator_payout_value0.022 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,249
author_reputation50,124,640,567,504
root_title"Vue用法的城市化比喻 / 网络研习社#39"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id91,440,440
net_rshares251,101,030,184
author_curate_reward""
vote details (12)
@nostalgic1212 ·
@tipu curate 0.02

Posted using [Partiko iOS](https://partiko.app/referral/nostalgic1212)
properties (22)
authornostalgic1212
permlinknostalgic1212-re-lemooljiang-vue-39-20191009t134400474z
categorycn
json_metadata{"app":"partiko","client":"ios"}
created2019-10-09 13:44:00
last_update2019-10-09 13:44:00
depth1
children1
last_payout2019-10-16 13:44:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length89
author_reputation1,478,806,002,181,760
root_title"Vue用法的城市化比喻 / 网络研习社#39"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id91,382,550
net_rshares0
@tipu ·
Upvoted &#128076;
properties (22)
authortipu
permlinkre-nostalgic1212-re-lemooljiang-vue-39-20191009t134400474z-20191009t134427
categorycn
json_metadata""
created2019-10-09 13:44:30
last_update2019-10-09 13:44:30
depth2
children0
last_payout2019-10-16 13:44:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length17
author_reputation55,911,178,531,114
root_title"Vue用法的城市化比喻 / 网络研习社#39"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id91,382,570
net_rshares0
@scisan ·
$0.15
相当形象的呢
👍  
properties (23)
authorscisan
permlinkpzbl4w
categorycn
json_metadata{"app":"steemit/0.1"}
created2019-10-13 15:46:09
last_update2019-10-13 15:46:09
depth1
children0
last_payout2019-10-20 15:46:09
cashout_time1969-12-31 23:59:59
total_payout_value0.076 HBD
curator_payout_value0.076 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length6
author_reputation-1,481,395,934,280
root_title"Vue用法的城市化比喻 / 网络研习社#39"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id91,516,173
net_rshares798,842,320,335
author_curate_reward""
vote details (1)