menu

Framework7 vue中页面跳转

date_range 13/10/2017 00:00

this.$f7.mainView.router.load({url: "/user-settings"})

哈哈哈

date_range 08/10/2017 00:00

framework7 vue With Messagebar实例

date_range 10/09/2017 00:00

<template> <f7-messages> <f7-message v-for=“message in messages” :text=“message.text” :label=“message.label” :date=“message.date” :name=“message.name” :avatar=“message.avatar” :type=“message.type” :day=“message.day” :time=“message.time” @click=“onClick” @click:text=“onTextClick” @click:name=“onNameClick” @click:avatar=“onAvatarClick” ></f7-message> </f7-messages> <f7-messagebar placeholder=“Message” send-link=“Send” @submit=“onSubmit”></f7-messagebar></template><script> export default { data: function () { return { name: ‘Vladimir’, avatar: ‘path/to/avatar-1.jpg’, messages: [ { day: ‘Wendesday’, time: ‘13:34’ }, { name: ‘Vladimir’, text: ‘How are you?’, label: ‘Sent in good mood :)’, avatar: ‘path/to/avatar-1.jpg’, date: ‘Yesterday 13:34’ }, { name: ‘Jane’, text: ‘I\‘m good, thank you!’, type: ‘received’, avatar: ‘path/to/avatar-2.jpg’, date: ‘Yesterday at 13:50’ } ] } }, methods: { onClick: function (event) { console.log(‘message click’); }, onAvatarClick: function () { console.log(‘avatar-click’); }, onTextClick: function () { console.log(‘text-click’); }, onNameClick: function () { console.log(‘name-click’); },
//提交时候获取内容并清空text.trim()内容 onSubmit: function (text, clear) { if (text.trim().length === 0) return; this.messages.push({ name: this.name, avatar: this.avatar, text: text, date: (function () { var now = new Date(); var hours = now.getHours(); var minutes = now.getMinutes(); return hours + ’:’ + minutes; })() }); // Clear Message Bar clear(); } } } </script>

framework7 vue Notification使用

date_range 10/09/2017 00:00

普通framework7
myApp.addNotification({ message: ‘Nice yellow button’, button: { text: ‘Click me’, color: ‘yellow’ } }); framework7 vue
  this.$f7.addNotification({
        message: ‘Nice yellow button’,
        button: {
            text: ‘Click me’,
            color: ‘yellow’
        }
    }); more https://framework7.io/docs/notifications.html

CORS Toggle 解决CORS 错误

date_range 10/09/2017 00:00

Access-Control-Allow-Headers:里添加你用到的内容
比如
X-CSRF-Token,Authorization,Content-Type

vue 使用js-hal hal json

date_range 07/09/2017 00:00

In Node.JS

Drupal8 使用views创建接口 获取当前用户信息

date_range 05/09/2017 00:00

1) Duplicate the default people view and rename it current_user. 2) Add a rest export route eg. rest/users/current_user. 3) Add a filter for current user. 4) Save all. 5) Retrieve the current user via http get request on example.com/rest/user/current_user?_format=hal_json

framework7获取路径参数

date_range 21/08/2017 00:00

 

framework7 vue Axios 加载第三方数据

date_range 21/08/2017 00:00

<template>
  <f7-page>
    <f7-navbar title=”About” back-link=”Back” sliding></f7-navbar>
 
 
    <ul v-if=”posts && posts.length”>
    <li v-for=”post of posts”>
      <p><strong></strong></p>
      <p></p>
    </li>
  </ul>   <ul v-if=”errors && errors.length”>
    <li v-for=”error of errors”>
     
    </li>
  </ul>
 
 
  </f7-page>
</template> <script>
//export default {}
import axios from ‘axios’; export default {
  data: () => ({
    posts: [],
    errors: []
  }),   // Fetches posts when the component is created.
  created() {
    axios.get(‘http://jsonplaceholder.typicode.com/posts’)
    .then(response => {
      // JSON responses are automatically parsed.
      this.posts = response.data
    })
    .catch(e => {
      this.errors.push(e)
    })     // async / await version (created() becomes async created())
    //
    // try {
    //   const response = await axios.get(http://jsonplaceholder.typicode.com/posts)
    //   this.posts = response.data
    // } catch (e) {
    //   this.errors.push(e)
    // }
  }
} </script>

微软OneNote垃圾中的战斗机

date_range 03/08/2017 00:00

编辑