Code Monkey home page Code Monkey logo

order-menue's Introduction

order-menue

项目介绍

本项目是使用Vue构建
基于vant组件库开发

运行项目

  1. 安装依赖:
cnpm install
  1. 启动服务
npm run serve

样式适配问题

  1. 介绍
本项目安装了rem适配依赖,会自动将px转换成rem,如果不想自动转换可写成大写PX或者Px。
依赖是lib-flexible以及postcss-px2rem。
  1. 样式设置
第一步,将设计稿调为750px宽度,在iPhone6中显示效果。
第二步,如果在设计稿中元素尺寸为100px,那么将元素设置为50px。即为设计稿的一半。
(注意如果使用PX或者Px,不转换rem,则在750px的设计稿中量出来宽度就是元素的真实宽度,不用除2,iphone6两个像素点为一个设备独立像素点)

Vant组件库的使用

  1. 全局按需引用vant组件
在main.js进行全局配置,按需引用,即任何组件均可直接使用vant组件;
如button的引用

import Vue from 'vue';
import { Button } from 'vant';

Vue.use(Button);
  1. 局部按需引用vant组件
即直接在组件内部引用组件并注册
如
import { Button } from 'vant';
export default{
  components:{
    "van-button":Button,
  }
}
  1. 组件样式问题
因为安装了rem适配依赖,本项目会自动将px转换成rem单位,所以写样式的时候自己注意一下。
会有什么影响暂时不明确,应该是问题不大。

sass的使用

  1. 全局变量
在variables.scss设置全局变量;
在组件中即可在scss中直接使用
如
<style lang="scss">
.hello{
  background-color: $color;
}
</style>
  1. 混合器声明
在mixin.scss设置全局混合器;
在组件中即可在scss中直接使用
如
<style lang="scss">
.hello{
  background-color: $color;
  @include hline(5px yellow dashed,20px)
}
</style>

order-menue's People

Contributors

yaofeng19940604 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.