C:\Users\ZHONGZHENHUA\cardBattle\src\App.vue

src/App.vue

<template>
<div id="app">
<!--
<img src="./assets/logo.png">
-->
<game-container></game-container>
<!--
<router-view/>
-->
</div>
</template> <script>
import GameContainer from './components/gamecontainer'
export default {
components: {
GameContainer
},
name: 'App'
}
</script> <style>
/**
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
**/
</style>

C:\Users\ZHONGZHENHUA\cardBattle\src\components\gamecontainer.vue

src/components/gamecontainer.vue

<template>
<div>
<header>
<div class="row">
<h1>Card Battle!</h1>
<section id="game" class="row">
<start-scene></start-scene>
</section>
</div>
</header>
<section class="how-to-play">
<h2>玩法介绍</h2>
<p>选择任意一张牌,然后观看点数的pk结果</p>
</section>
<footer>
<p>给我打个赏把!</p>
<img id="payme" src="../../static/payme.jpg">
</footer>
</div>
</template> <script>
import StartScene from './startscenecomponent'
export default {
components: {
StartScene
}
}
</script> <!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
#game {
wdith: 480px;
height:600px;
border-radius: 8px;
overflow: hidden;
} .scene {
width: %;
height: %;
position: absolute;
overflow: hidden;
border-radius: 8px;
transition: all.3s ease-out; } #payme {
width:240px;
height: 256px;
}
</style>

C:\Users\ZHONGZHENHUA\cardBattle\src\components\HelloWorld.vue

src/components/HelloWorld.vue

<template>
<div class="hello">
<h1>{{ msg }}</h1>
<h2>Essential Links</h2>
<ul>
<li>
<a
href="https://vuejs.org"
target="_blank"
>
Core Docs
</a>
</li>
<li>
<a
href="https://forum.vuejs.org"
target="_blank"
>
Forum
</a>
</li>
<li>
<a
href="https://chat.vuejs.org"
target="_blank"
>
Community Chat
</a>
</li>
<li>
<a
href="https://twitter.com/vuejs"
target="_blank"
>
Twitter
</a>
</li>
<br>
<li>
<a
href="http://vuejs-templates.github.io/webpack/"
target="_blank"
>
Docs for This Template
</a>
</li>
</ul>
<h2>Ecosystem</h2>
<ul>
<li>
<a
href="http://router.vuejs.org/"
target="_blank"
>
vue-router
</a>
</li>
<li>
<a
href="http://vuex.vuejs.org/"
target="_blank"
>
vuex
</a>
</li>
<li>
<a
href="http://vue-loader.vuejs.org/"
target="_blank"
>
vue-loader
</a>
</li>
<li>
<a
href="https://github.com/vuejs/awesome-vue"
target="_blank"
>
awesome-vue
</a>
</li>
</ul>
</div>
</template> <script>
export default {
name: 'HelloWorld',
data () {
return {
msg: 'Welcome to Your Vue.js App'
}
}
}
</script> <!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
font-weight: normal;
}
ul {
list-style-type: none;
padding: ;
}
li {
display: inline-block;
margin: 10px;
}
a {
color: #42b983;
}
</style>

C:\Users\ZHONGZHENHUA\cardBattle\src\components\startscenecomponent.vue

src/components/startscenecomponent.vue

<template>
<div id="start-scene" class="scene">
<a href="#" id="start-btn" class="button"></a>
</div> </template> <script>
export default {
}
</script> <!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
#start-scene {
background: url(../../static/images/start-scene-bg.png) no-repeat;} .button{
position:absolute;
width: %;
height: %;
top:;
left:;
}
</style>

C:\Users\ZHONGZHENHUA\cardBattle\index.html

index.html

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>CardBattle</title>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

VUE+WebPack实现精美前端游戏:CardBattle的游戏场景设置的更多相关文章

  1. VUE+WebPack实现精美Html5游戏设计:纸牌战争

  2. vue+webpack实践

    最近使用了vue来做SPA应用,记一波学习笔记. 使用vue+webpack实现前端模块化. vuejs——轻量.学习成本低.双向绑定.无dom的操作.组件的形式编写 推荐官方文档 vue.js官方文 ...

  3. windows环境下搭建vue+webpack的开发环境

    前段时间一直在断断续续的看vue的官方文档,后来就慢慢的学习搭建vue的开发环境,已经有将近两周了,每到最后一步的时候就会报错,搞的我好郁闷,搁置了好几天,今天又接着搞vue的开发环境,终于成功了.我 ...

  4. Vue + Webpack + Vue-loader 1

    Vue + Webpack + Vue-loader 原文地址:https://lvyongbo.gitbooks.io/vue-loader/content/ Vue-loader 是什么? vue ...

  5. 从零开始:一个正式的vue+webpack项目的目录结构是怎么形成的

    如何从零开始一个vue+webpack前端工程工作流的搭建,首先我们先从项目的目录结构入手.一个持续可发展,不断加入新功能,方便后期维护的目录结构究竟是长什么样子的?接下来闰土大叔带你们一起手摸手学起 ...

  6. Vue + webpack 项目实践

    Vue.js 是一款极简的 mvvm 框架,如果让我用一个词来形容它,就是 “轻·巧” .如果用一句话来描述它,它能够集众多优秀逐流的前端框架之大成,但同时保持简单易用.废话不多说,来看几个例子: & ...

  7. nodejs, vue, webpack 项目实践

    vue 及 webpack,均不需要与nodejs一期使用,他们都可以单独使用到任何语言的框架中. http://jiongks.name/blog/just-vue/ https://cn.vuej ...

  8. Vue + WebPack + Typescript初学者VSCode项目 (按需加载、跨域调试、await/async)

    万事开头难,一个好的Hello World程序可以节省我们好多的学习时间,帮助我们快速入门.Hello World程序之所以是入门必读必会,就是因为其代码量少,简单易懂.但我觉得,还应该做到功能丰富, ...

  9. vue+webpack开发(一)

    一开始接触这个vue+webpack的时候,实在是摸不着头脑,根本无从下手. 但是经过这两天的研究,其实你会发现vue其实并不难,难度都在webpack你对webpack的理解. webpack顾名思 ...

随机推荐

  1. groovy gradle 构建配置

    参考配置 apply plugin: "idea" apply plugin: "groovy" apply plugin: "eclipse&quo ...

  2. yum命令集

    升级相关命令: yum update : 安装所有更新软件 yum update xxx : 仅更新指定的软件 yum check-update : 列出所有可更新的软件清单 yum list : 列 ...

  3. 一段四表联查外加字符拼接的sql,留存备查

    select DISTINCT [P_ID],[P_CODE],[P_CODE_OLD],[P_NAME],[NATIVE_PLACE],[GENDER],[EDUCATION],[EMPLOY_DA ...

  4. Linux c- libevent

    libevent是一个事件触发的网络库,适用于windows.linux.bsd等多种平台,内部使用select.epoll.kqueue等系统调用管理事件机制.著名分布式缓存软件memcached也 ...

  5. 推荐PHP程序员进阶的好书

    <UNIX网络编程卷1(第3版)> <UNIX网络编程卷2(第2版)> <UNIX环境高级编程(第3版)> <UNIX编程艺术> <MySQL技术 ...

  6. HDOJ5437(优先队列)

    Alisha’s Party Time Limit: 3000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) ...

  7. MySQL Join算法与调优白皮书(三)

    Batched Key Access Join Index Nested-Loop Join虽好,但是通过辅助索引进行链接后需要回表,这里需要大量的随机I/O操作.若能优化随机I/O,那么就能极大的提 ...

  8. Gradle: Can't load library: native-platform.dll

    Eclipse 导入 Gradle project 时总是报错:Can't load library: native-platform.dll. 解决方案: 进入 Windows -> Pref ...

  9. Appium+python自动化23-Android夜神模拟器

    前言 Android SDK虽然也自带了模拟器,但是那速度会让你怀疑人生,并且不稳定经常卡死异常.夜神模拟器可以说是android模拟器里面的一个神器. 环境安装 1.官网下载地址:https://w ...

  10. configure: error: mcrypt.h not found. Please reinstall libmcrypt.

    编译出现错误: configure: error: mcrypt.h not found. Please reinstall libmcrypt. 解决方法: yum install -y libmc ...