Java知识分享网 - 轻松学习从此开始!    

Java知识分享网

        
AI编程,程序员挑战年入30~100万高级指南 - 职业规划
SpringBoot+SpringSecurity+Vue权限系统高级实战课程        

IDEA永久激活

Java微信小程序电商实战课程(SpringBoot+VUe)

     

AI人工智能学习大礼包

     

PyCharm永久激活

66套java实战课程无套路领取

     

Cursor+Claude AI编程 1天快速上手视频教程

     

Fullstack Vue PDF 下载


时间:2024-07-06 11:55来源:http://www.java1234.com 作者:转载  侵权举报
Fullstack Vue
失效链接处理
Fullstack Vue PDF 下载

 
 
相关截图:
 


主要内容:
 
Making the view data-driven
Driving the template with data will allow us to dynamically render the view based upon the data
that we give it. Let’s familiarize ourselves with the applications data model.
The data model
Within our app directory, we’ve included a file called seed.jsseed.js contains sample data for a
list of submissions (it seeds our application with data). The seed.js file contains a JavaScript object
called Seed.submissionsSeed.submissions is an array of JavaScript objects where each represents
a sample submission object:
const submissions [
{
id: 1,
title'Yellow Pail',
description'On-demand sand castle construction expertise.',
url'#',
votes: 16,
avatar'../public/images/avatars/daniel.jpg',
submissionImage'../public/images/submissions/image-yellow.png',
},
// ...
]
Each submission has a unique id and a series of properties including titledescriptionvotes, etc.
Since we only have a single submission displayed in our view, we’ll first focus on getting the data
from a single submission object (i.e. submissions[0]) on to the template.
The Vue Instance
The Vue instance is the starting point of all Vue applications. A Vue instance accepts an options
object which can contain details of the instance such as its template, data, methods, etc. Root level
Vue instances allow us to reference the DOM with which the instance is to be mounted/attached to.
Let’s see an example of this by setting up the Vue instance for our application. We’ll write all our
Vue code for the rest of this chapter inside the main.js file. Let’s open main.js and create the Vue
instance using the Vue function:
 


 
 
 
------分隔线----------------------------


锋哥推荐