Vue实现音乐播放器(四):页面入口+header组件的编写
首先下载三个包

babel-runtime对es语法进行转义
fastclick解决移动端点击300毫秒延迟的问题
babel-polyfill对es6 api进行转义
下载了包之后要在main.js中引入 注意babel-polyfill要引在最前面
在main.js中引入stylus文件夹下的index.styl文件

完成m-header组件

MHeader组件
<template>
<div class="m-header">
<div class="icon"></div>
<h1 class="text">Chicken Music</h1>
<router-link tag="div" class="mine" to="/user">
<i class="icon-mine"></i>
</router-link>
</div>
</template> <script type="text/ecmascript-6">
export default {}
</script> <style scoped lang="stylus" rel="stylesheet/stylus">
@import "../../common/stylus/variable"
@import "../../common/stylus/mixin" .m-header
position: relative
height: 44px
text-align: center
color: $color-theme
font-size: 0
.icon
display: inline-block
vertical-align: top
margin-top: 6px
width: 30px
height: 32px
margin-right: 9px
background: url('./logo@2x.png') //因为这里如果引入stylus语法不知道为什么一直报错 所以就直接写了
background-size: 30px 32px
.text
display: inline-block
vertical-align: top
line-height: 44px
font-size: $font-size-large
.mine
position: absolute
top: 0
right: 0
.icon-mine
display: block
padding: 12px
font-size: 20px
color: $color-theme
</style>
在App.vue中使用该组件
注意:解析图片的时候要下载url-loader包和file-loader包
<template>
<div id="app">
//第三步:使用该组件
<m-header></m-header>
</div>
</template> <script type="text/ecmascript-6">
//第一步:引入该组件
import MHeader from './components/m-header/m-header.vue' export default {
components: {
//第二步:注册该组件
MHeader
}
}
</script> <style scoped lang="stylus" rel="stylesheet/stylus">
</style>
Vue实现音乐播放器(四):页面入口+header组件的编写的更多相关文章
- vue实现音乐播放器实战笔记
原文链接:https://blog.csdn.net/Forever201295/article/details/80266600 一.项目说明该播放器的是基于学习vue的实战练习,不用于其他途径.应 ...
- Vue中音乐播放器
一.安装依赖 yarn add vue-aplayer or` npm i vue-aplayer 二.使用 <template> <div class="vue_ap ...
- Vue实现音乐播放器(七):轮播图组件(二)
轮播图组件 <template> <div class="slider" ref="slider"> <div class=&qu ...
- Vue实现音乐播放器(六):jsonp的应用+抓取轮播图数据
用jsonp来获取数据 通过封装方法来获取 在src文件夹下的api文件夹里面去封装一些获取相关部分组件的数据的方法 在api文件夹下的recommend.js中 配置一下公共参数 请求的真实的u ...
- Vue实现音乐播放器(二)-Vue-cli脚手架安装
- 躁!DJ 风格 Java 桌面音乐播放器
本文适合有 Java 基础知识的人群,跟着本文可学习和运行 Java 版桌面 DJ 音乐播放器. 本文作者:HelloGitHub-秦人 HelloGitHub 推出的<讲解开源项目>系列 ...
- Android 实现简单音乐播放器(一)
今天掐指一算,学习Android长达近两个月了,今天开始,对过去一段时间的学习收获以及遇到的疑难杂症做一些总结. 简单音乐播放器是我自己完成的第一个功能较为完整的APP,可以说是我的Android学习 ...
- 一个开源音乐播放器,低仿QQ音乐!
有暇,弄了个音乐播放器,页面效果整体上参考了QQ音乐,相关API使用了易源数据提供的相关接口(https://www.showapi.com/api/lookPoint/213),在此表示感谢.先来看 ...
- vue——一个页面实现音乐播放器
请忽略下面这段文字年关将至,时间好歹又多出了些许.却不敢过度消遣.岁月未曾饶过我,我亦不想饶过岁月.且将它塞得膨胀,让这一年看似加更充实.不曾料想我一个爱些风花雪月.研墨行歌之人,却做起了碼农这一行当 ...
随机推荐
- git Permanently added the RSA host key for IP address '13.250.177.223' to the list of known hosts.
只要把那个ip地址添加进hosts列表中就可解决. 参见:https://blog.csdn.net/hunhun1122/article/details/79752125
- nginx 启动关闭
#检查语法 /application/nginx/sbin/nginx –t #平滑重启 /application/nginx/sbin/nginx –s reload #不间断服务重启,将 pid ...
- Nginx1.3.15导致Wordpress,Drupal等框架无限重定向的解决方案
Wordpress建立的站点出现无限循环重定向问题.很多人遇到这个问题,并不是单纯Wordpress,Drupal, PHPCake等框架也都遇到同样的问题. 新版本的Nginx在收到 http:// ...
- PAT Advanced 1058 A+B in Hogwarts (20 分)
If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- a ...
- PAT Advanced 1065 A+B and C (64bit) (20 分)(关于g++和clang++修改后能使用)
Given three integers A, B and C in [−], you are supposed to tell whether A+B>C. Input Specificati ...
- 分页控件SSTab
一.分页控件SSTab概述1.作用:采用分页形式查询或编辑数据表中数据.2.添加到控件箱菜单命令:工程 | 部件,选择:Microsoft Tabbed Dialog Control 6.0 (SP6 ...
- 03python面向对象编程4
http://c.biancheng.net/view/2287.html 1.1定义类和对象 在面向对象的程序设计过程中有两个重要概念:类(class)和对象(object,也被称为实例,insta ...
- 10年前文章_嵌入开发使用的服务器配置 tftp ,http,nfs
tftp server 安装 dnsmasq, 在目录 /etc/dnsmasq.d 下生成包含如下内容的配置文件 tftp.conf enable-tftptftp-root=/tftpboot ...
- 【学习】016 MySQL数据库优化
MySQL如何优化 表的设计合理化(符合3NF) 添加适当索引(index) [四种: 普通索引.主键索引.唯一索引unique.全文索引] SQL语句优化 分表技术(水平分割.垂直分割) 读写[写: ...
- Python核心技术与实战——三|字符串
一.字符串基础 Python的字符串支持单引号('').双引号("")和三引号之中('''....'''和"""...""&quo ...