vue 各种如何使用方法

安装 vue cli3 安装 Vue Cli npm install -g @vue cli 创建一个项目 vue create baifubin

 

安装 vue cli3

# 安装 Vue Cli
npm install -g @vue/cli
# 创建一个项目
vue create baifubin
# 打开图形化界面
vue ui
安装 vue 移动端rem 通过cli3 直接搜索或npm

npm install  postcss-pxtorem

"postcss": {
 "plugins": {
 "autoprefixer": {
 "browsers": ["Android >= 4.0", "iOS >= 7"]
 },
 "postcss-pxtorem": {
 "rootValue": 37.5,
 "propList": [
 "*"
 
 ]
 
 }
 },
修改ui中的默认样式

.checked
 margin 15px 0px
 >>> .van-checkbox__label
 color #fff

 

 
// 固定 body
.scrollFixed{
    position:fixed;
    width: 100%;
}
// 获取body滚动位置
this.scrollTop = document.scrollingElement.scrollTop
document.body.classList.add('scrollFixed')
document.body.style.top = - this.scrollTop + 'px'

// 隐藏弹出层返回滚动位置
document.body.classList.remove('scrollFixed')
document.scrollingElement.scrollTop = this.scrollTop


// 倒计时60s
const thime_count = 60
that.count = thime_count
that.show = false
that.timer = setInterval(() => {
       if (that.count > 0 && that.count <= thime_count) {
             that.count--
        } else {
               that.show = true;
               clearInterval(that.timer)
                that.timer = null
          }
  }, 1000) 

 

 #table-role /deep/ .el-table__empty-block{
  overflow: auto;
}
 Sass 之类的预处理器无法正确解析 >>>。这种情况下你可以使用 /deep/ 操作符取而代之——这是一个 >>> 的别名,同样可以正常工作。 
写法为:父组件cssName+ /deep/+第三方库需要更改的cssName
禁止返回到 进入页面,删除history 路由

如 A(我的订单列表) > B (退款页面或者其他详情页 然后返回A) > A (再返回就是到B)
this.$router.replace({})

 


 

您可能有感兴趣的文章
vue从后台渲染文章列表以及根据id跳转文章详情详解

Vue2.0 如何实现歌手列表滚动及右侧快速入口功能

vue.javascript删除列表中的一行

在vue中给列表中的奇数行添加class的如何实现方法

Vue之项目搭建