- Vue.js 2 Web Development Projects
- Guillaume Chau
- 137字
- 2021-07-02 22:34:31
Setting up the project
Download the chapter 2 files and extract the project setup into an empty folder. You should have the following content:
- index.html: The web page
- style.css: The CSS file
- svg: Contains all the SVG images of the game
- cards.js: With all the cards data ready to use
- state.js: Where we will consolidate the main data properties of the game
- utils.js: Where we will write useful functions
- banner-template.svg: We will use the content of this file later
We will start with our main JavaScript file--create a new file called main.js.
Open the index.html file and add a new script tag referencing the new file, just after the state.js one:
<!-- Scripts -->
<script src="utils.js"></script>
<script src="cards.js"></script>
<script src="state.js"></script>
<script src="main.js"></script>
Let's create the main instance of our app in the main.js file:
new Vue({
name: 'game',
el: '#app',
})
We are now ready to go!
推薦閱讀
- Python數據分析基礎
- 認識編程:以Python語言講透編程的本質
- Java FX應用開發教程
- Learning Linux Binary Analysis
- Servlet/JSP深入詳解
- 數據結構習題精解(C語言實現+微課視頻)
- Building Mapping Applications with QGIS
- HTML5+CSS3網站設計基礎教程
- concrete5 Cookbook
- HDInsight Essentials(Second Edition)
- 軟件供應鏈安全:源代碼缺陷實例剖析
- Nagios Core Administration Cookbook(Second Edition)
- 計算機應用基礎項目化教程
- 貫通Tomcat開發
- SEO教程:搜索引擎優化入門與進階(第3版)