我将使用两个外部脚本作为支付网关.现在两者都放在'index.html'文件中.但是,我不想在开头加载这些文件.仅当用户打开特定组件(使用路由器视图)时才需要支付网关.反正有没有实现这个目标?
我刚刚开始使用Sequelize和Sequelize CLI
由于这是一个开发时间,因此经常添加和删除列.将新列添加到现有模型的最佳方法是什么?
例如,我想要一个新的专栏' 完成 '到Todo模型.我将此列添加到models/todo.js.什么是下一步?
我试过了 sequelize db:migrate
不工作:"没有执行迁移,数据库架构已经是最新的."
我正在使用sequelize ORM从PSQL DB中获取数据.但是,当我检索某些内容时,会给出一大堆数据.我想要的唯一数据是'dataValues'.当然,我可以使用object.dataValues.但是,还有其他好的解决方案吗?
我正在使用Sequelize 4.10
我正在使用Vuex显示'store.js'的用户列表.那个js文件有这样的数组.
var store = new Vuex.Store({
state: {
customers: [
{ id: '1', name: 'user 1',},
]
}
})
Run Code Online (Sandbox Code Playgroud)
我想在同一个数组中插入一组新值
{id:'1',名称:'用户1',}
以上值是从URL(vue-resource)获得的.下面是将获得的数据推送到数组的代码.但是,数据未插入
mounted: function() {
this.$http.get('http://localhost/facebook-login/api/get_customers.php')
.then(response => {
return response.data;
})
.then(data => {
store.state.customers.push(data) // not working!!
console.log(data) // prints { id: '2', name: 'User 2',}
store.state.customers.push({ id: '2', name: 'User 2',})
});
}
Run Code Online (Sandbox Code Playgroud) Facebook曾经在Facebook共享按钮中允许自定义参数,但它现在不起作用.我需要的是创建一个Facebook共享按钮,它将具有自定义标题,网址,图像,描述等.使用元标记无法完成,因为单个页面上有多个共享按钮.每个应该有一个不同的标题,网址,图像等.我听说它可以使用Facebook应用程序 - 使用应用程序ID或其他东西.
我试过这个,但它不起作用:
<a title="send to Facebook"
href="http://www.facebook.com/sharer.php?s=100&p[title]=YOUR_TITLE&p[summary]=YOUR_SUMMARY&p[url]=YOUR_URL&p[images][0]=YOUR_IMAGE_TO_SHARE_OBJECT"
target="_blank">
Run Code Online (Sandbox Code Playgroud) 我有一个 HTML 代码,其中有一些 JS 库使用的诸如@click、之类的属性。@autocomplete:change
当我使用 DOMDocument 解析 HTML 时,这些属性将被删除。
示例代码:
<?php
$content = <<<'EOT'
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head></head>
<body>
<a role="tab" @click="activeType=listingType"></a>
<input type="text" @autocomplete:change="handleAutocomplete">
</body>
</html>
EOT;
// creating new document
$doc = new DOMDocument('1.0', 'utf-8');
$doc->recover = true;
$doc->strictErrorChecking = false;
//turning off some errors
libxml_use_internal_errors(true);
// it loads the content without adding enclosing html/body tags and also the doctype declaration
$doc->LoadHTML($content, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
echo $doc->saveHTML();
?>
Run Code Online (Sandbox Code Playgroud)
输出:
<!DOCTYPE html>
<html …Run Code Online (Sandbox Code Playgroud) 我有一个数组用户列表.我想根据顶部的搜索框(名称)过滤它们.我看到VueJS 1中有过滤器.但是VuesJS 2中没有过滤器.如何在VueJS 2中实现这一点
<input type="text" v-model="search"/>
<div class="row profile" v-for="customer in customers">
<div class="col-md-offset-1 col-md-3"><img :src="customer.profile_pic" class="profile-pic" /></div>
<div class="col-md-8"><h4 class="name">{{customer.name}}</h4></div>
</div>
<script>
data: function () {
return{
search: '',
customers: [
{ id: '1', name: 'user 1', profile_pic: 'https://i.stack.imgur.com/CE5lz.png', email:'ab@gmail.com', phone:'+91959657248', unread:'0' },
{ id: '2', name: 'user 2', profile_pic: 'https://i.stack.imgur.com/CE5lz.png', email:'abcd@gmail.com', phone:'+919456664023', unread:'0' },
{ id: '3', name: 'user 3', profile_pic: 'https://i.stack.imgur.com/CE5lz.png', email:'test@gmail.com', phone:'+919566565065', unread:'0' },
{ id: '4', name: 'user 4', profile_pic: 'https://i.stack.imgur.com/CE5lz.png', email:'sample@gmail.com', phone:'+916466004566', unread:'0' …Run Code Online (Sandbox Code Playgroud) 我试图使用Vuejs中的过渡动画两个div.下面是我使用的代码(jsfiddle).但不知道为什么它不起作用
https://jsfiddle.net/k6grqLh1/16/
VUE
<div id="vue-instance">
<div>
<transition name="fade">
<div v-show="show">
<div class="box yellow"></div>
</div>
</transition>
<transition name="fade">
<div v-show="!show">
<div class="box blue"></div>
</div>
</transition>
<a href="#" @click="show = !show">Change</a>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
.fade-enter-active, .fade-leave-active {
transition: opacity .5s
}
.fade-enter, .fade-leave-to /* .fade-leave-active in <2.1.8 */ {
opacity: 0
}
.box {
width:200px;height:200px;
}
.yellow{
background-color:yellow;
}
.blue{
background-color:blue;
}
Run Code Online (Sandbox Code Playgroud)
JS
var vm = new Vue({
el: '#vue-instance',
data: {
show: true
}
});
Run Code Online (Sandbox Code Playgroud) 我正在使用以下代码通过将高度降低到0px来为v-if元素设置动画.动画效果很好.但问题是我要指定元素的初始高度是CSS.对于一个元素,这没关系,但我想将此动画应用于多个元素.我怎样才能解决这个问题?无论高度如何,动画效果都很好!
<transition name="fadeHeight" mode="out-in">
<div v-if="something">
<p>something over here where the height is not constant</p>
</div>
</transition>
.fadeHeight-enter-active,
.fadeHeight-leave-active {
transition: all 0.2s;
height: 230px;
}
.fadeHeight-enter,
.fadeHeight-leave-to
{
opacity: 0;
height: 0px;
}
Run Code Online (Sandbox Code Playgroud) vue.js ×5
vuejs2 ×5
javascript ×2
node.js ×2
sequelize.js ×2
animation ×1
arrays ×1
css ×1
domdocument ×1
facebook ×1
ios ×1
ipad ×1
php ×1
psql ×1
share-button ×1
vue-resource ×1
vue-router ×1
xcode ×1