Code Monkey home page Code Monkey logo

element-ui-validation-form's Introduction

Использование API Trello c помощью Vue

Live Demo here.

config ApiTrello.js

import axios from 'axios';

// Example public board 

  const key = 'a8baabbb0068e0ea8ccd2b02a84c2c48';
  const token = '1dd44945a26e7aad43a71903a8182252772fdf236ef211f320c4d7a7ed21fe3c';
  const API_URL_TRELLO = 'https://api.trello.com/1/cards?key='+ key +'&token=' + token

let ApiTrello = axios.create({
    baseURL: API_URL_TRELLO,
    headers: {
      'Accept': 'application/json; charset=utf-8',
      'Accept-Language': 'ru-RU,ru;q=0.5',
      'Content-Type': 'application/json'
    }
  })
  
export default ApiTrello;

Example request

const idBoard = "5c35c65af44c5f13f13fcc65"
const idList = "5c35c68a3a95a04f8e7f0acd"
let description = `Форма: ${this.title}\n Имя: ${this.ruleForm.name}\n Телефон: ${this.ruleForm.phone}\n E-mail: ${this.ruleForm.email}`;
let data = {
    "name":`Запрос с сайта ${window.location.href}`,
    "desc": description,
    "idBoard": idBoard,
    "idList": idList,
}
new Promise((resolve, reject) => {
    ApiTrello.post('', data)
        .then(response => {
            this.dialogFormVisible = false
            resolve(response)
        })
        .catch(error => {
            console.log(error)
            reject(error)
        })
})

Links

  • ElementUI - Element, a Vue 2.0 based component library for developers, designers and product managers
  • Trello Api - Trello API Introduction
  • Vue CLI 3 - Standard Tooling for Vue.js Development

element-ui-validation-form's People

Contributors

taijased avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 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.