Git Product home page Git Product logo

wepy-com-toptip's Introduction

Toptip

wepy 的插件使用不是很人性化,但还是能用的~ 要不然我也不会写这个东西。

使用方法

// 第一步
import Toptip from '../../components/weui/toptip'

// 第二步,加入 components
components = {
  toptip: Toptip,
}

// 第三步,把这一行放到 template 某一个位置, 最后就可以
<toptip></toptip>

// 第四步,正式调用,this 指的是当前组件
let promise = this.$invoke('toptip', 'show', {
  type: 'success',
  text: '成功了~',
});

Options

let promise = this.$invoke('toptip', 'show', {
  duration: 1000,  // 可选
  type: 'success', // 可选. 或者 'error'
  text: '成功了~', // 随便写什么~
});

样式

我用的是 weui 的样式,如果你没有用,那么就要把下面的 css,加到 style 里面去

.weui-toptips {
  position: fixed;
  transform: translateZ(0) translateY(-100%);
  top: 0;
  left: 0;
  right: 0;
  padding: 5px;
  font-size: 14px;
  text-align: center;
  color: #FFFFFF;
  z-index: 5000;
  word-wrap: break-word;
  word-break: break-all;
}

.weui-toptips_warn {
  background-color: #E64340;
}

.weui-toptips_success {
  background-color: #1AAD19;
}

wepy-com-toptip's People

Contributors

ochukai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

mingo6

wepy-com-toptip's Issues

文件中引入的wx报错

let animation = wx.createAnimation({
        duration: this.animateDuration,
        timingFunction: 'ease-out'
      })

报错信息: 33:25 error 'wx' is not defined no-undef

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.