Giter Club home page Giter Club logo

weex-dingtalk's Introduction

weex-dingtalk Doc

Build Status

weex-dingtalk is a JavaScript SDK powered by Dingtalk weex Container, which is an awesome solution for building Dingtalk microapp with extremely high performanece.

Usually you can build your microapp in Dingtalk as a traditional webapp, however sometimes your users are unsatisfied with the poor performance of your webapp. Why? Nowadays the gap between web and native, in the aspect of performance and user experience, is still wide. You might feel frustrated to optimize the performance of your webapp, but finally bring just a little improvement. That is why we need weex.

With the help of weex, you can focus on your business, no more need to worry about the performance, just enjoy the fun of coding and building your microapp. The microapps based on weex will look so elegant and run so smoothly that your users cannot tell the difference between a weex microapp developed by javascript and a native user interface developed by java or objective-c.

The code you write for a weex microapp is javascript and css, you will feel so familiar if you are a web developer. Under the hood, weex render engine parse your code and render a completely native user interface, rather than a web user interface.

Enjoy the fun of building dingtalk microapp with weex ☺

For Chinese

SDK中文文档

Install

npm install weex-dingtalk --save

Note:using --save save weex-dingtalk version in your package.json

How using it?

it's your weex application entry(weex-entry.js):

  import Hello from './Hello.vue';
  Hello.el = '#app';
  new Vue(Hello);

then Vue code(Hello.vue):

    <template>
        <div class="wrapper">
            <text class="title">Hello icepy</text>
            <text class="subtitle" v-on:click="getClick">{{ link }}</text>
        </div>
    </template>
    <script>

        var stream = weex.requireModule('stream');
        var modal = weex.requireModule('modal');
        var dingtalk = require('weex-dingtalk');

        export default {
            name: 'hello',
            data: function(){
                return {
                    link: 'DingTalk'
                }
            },
            mounted: function(){
              dingtalk.ready(function(){
                const dd = dingtalk.apis;
                // 设置导航
                dd.biz.navigation.setTitle({
                    title: 'icepy'
                });
              });
            },
            methods: {
                getClick: function(){
                  modal.toast({
                    message: 'Hello World ICEPY !!!',
                    duration: 2
                  });
                }
            }
        }
    </script>
    <style>
      .wrapper {
        display: flex;
        flex-direction: column;
        justify-content: center;
        width: 750px;
        height: 1000px;
        background-color: #333377;
      }
      .title {
        font-size: 60px;
        color: #505050;
        text-align: center;
      }
      .subtitle {
        display: block;
        font-size: 30px;
        color: #AAAAAA;
        xxxx: static;
        text-align: center;
        margin-top: 20px;
      }
    </style>

Note:

  • call js-api need to write in ready method

example:

import dingtalk from 'weex-dingtalk';
dingtalk.ready(function(){
  const dd = dingtalk.apis;
  dd.biz.navigation.setTitle({
      title: 'icepy'
  });
})
  • the js-api for getting user will work, only call dingtalk.config once

example:

import dingtalk from 'weex-dingtalk';
dingtalk.config({
  any Object your server response sign
});
  • using dingtalk.error register error handler

example:

import dingtalk from 'weex-dingtalk';
dingtalk.error(function(err){
  console.log(err);
});
  • fetch all js-api , only using dingtalk.apis, its in 'dingtalk.ready' method

example:

import dingtalk from 'weex-dingtalk';
dingtalk.ready(function(){
  const dd = dingtalk.apis;
});

Describe the weex-dingtalk apis

  • config (Function | 参数 Object | 返回值 void)
  • ready (Function | 参数 Function Callback | 返回值 void)
  • error (Function | 参数 Object )
  • apis (Object)
  • on register event handler( like addEventListener)
  • off remove event handler(like removeEventListener)

see other: https://open-doc.dingtalk.com/doc2/detail?spm=0.0.0.0.O1cH5b&treeId=171&articleId=104906&docType=1

How runing Web

Web:

import dingtalk from 'weex-dingtalk';

dingtalk.ready(function(){
  const dd = dingtalk.apis;
  // 设置导航
  dd.biz.navigation.setTitle({
      title: 'icepy'
  });
});

weex-dingtalk's People

Contributors

icepy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

weex-dingtalk's Issues

Add .babelrc to .npmignore file

Hi I am using your library and for some reason my webpack build process is picking up your .babelrc file making my builds fail because I don't have all the plugins and presets you use in your library.

This shouldn't be happening because my code is not building your library (and the plugins/presets from your library are under devDependencies), your library is compiled before publishing to dist js, so I shouldn't need any of your build-process stuff. If I remove project_root/node_modules/weex-dingtalk/.babelrc file the build works as normal.

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.