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
date_range 10/09/2017 00:00
Access-Control-Allow-Headers:里添加你用到的内容
比如
X-CSRF-Token,Authorization,Content-Type
date_range 05/09/2017 00:00
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>
date_range 24/07/2017 00:00
use Drupal\node\Entity\Node;
use Drupal\Core\Url;
public function submitForm(array &$form, FormStateInterface $form_state) {
//save Company as node
$newCompanyNode = Node::create([
'type' => 'company',
'title' => $form_state->getValue('company'),
//'field_name' => $value,
]);
$newCompanyNode->save();
drupal_set_message('Your company has been registered.', 'status');
date_range 05/07/2017 00:00
Use the Json::decode() method:
use Drupal\Component\Serialization\Json;
...
$decoded = Json::decode($data);