一入前端深似海,聊聊vue.js / 网络研习社#11

in #cn5 years ago

vue.jpg

https://cn.vuejs.org

一入前端深似海,从此阿花是路人!

运行着nodejs,要开始多学下js, 一拿到js ,又要多学下vue.js !貌似坑是越挖越大啊。我这最喜用wordpress神器建站的人,学起js来,还是有那么点费劲。

什么是Vue.js

  • Vue.js 是目前最火的一个前端框架,React是最流行的一个前端框架(React除了开发网站,还可以开发手机App, Vue语法也是可以用于进行手机App开发的,需要借助于Weex)
  • Vue.js 是前端的主流框架之一,和Angular.js、React.js 一起,并成为前端三大主流框架!
  • Vue.js 是一套构建用户界面的框架,只关注视图层,它不仅易于上手,还便于与第三方库或既有项目整合。(Vue有配套的第三方类库,可以整合起来做大型项目的开发)
  • 前端的主要工作?主要负责MVC中的V这一层;主要工作就是和界面打交道,来制作前端页面效果;MVC 是后端的分层开发概念;MVVM是前端视图层的概念,主要关注于 视图层分离,也就是说:MVVM把前端的视图层,分为了 三部分 Model, View , ViewModel。
  • Vue.js 的目标是通过尽可能简单的 API 实现响应的数据绑定和组合的视图组件。

简单来一段

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="./lib/vue.js"></script>
</head>
<body>

  <div id="app"></div>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                msg: 'hello world',
                tata: 'tiantian'
            }
        })
    </script>
</body>
</html>

vue通过数据绑定和渲染,不再操作DOM元素,而是专注于业务逻辑。它的优秀的地方还有很多,大家有兴趣可以玩玩。


网络研习社系列文章:


@lemooljiang #network-institute

Sort:  

Congratulations @lemooljiang! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You got more than 3500 replies. Your next target is to reach 3750 replies.

You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:

The Steem blockchain survived its first virus plague!
Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.16
TRX 0.16
JST 0.030
BTC 58866.42
ETH 2515.85
USDT 1.00
SBD 2.46