我遇到了一个问题,我通过cookie来解决它,但我想解决没有cookie的问题.我有一个名为app-header的组件,它有另一个叫做outmodal的组件.现在,我的第一个Vue实例需要组件app-header.
var vue = new Vue({
el : "html",
data : {
title : "Site Title",
description : "description of page",
keywords : "my keywords",
view : "home",
login : "login"
},
components:{
"app-header" :require("../../components/header"),
"app-footer" :require("../../components/footer"),
"home" :require("../../views/home")
},
});
Run Code Online (Sandbox Code Playgroud)
app-header的代码
var Vue = require("vue");
Vue.partial("login",require("../../partials/login.html"));
Vue.partial("logged",require("../../partials/logged.html"));
module.exports = {
template : require("./template.html"),
replace : true,
components : {
outmodal : require("../outmodal")
},
props : ['login']
}
Run Code Online (Sandbox Code Playgroud)
出口代码
var Vue = require("vue");
Vue.partial("loginModal",require("../../partials/loginModal.html"));
module.exports = {
template : require("./template.html"), …
Run Code Online (Sandbox Code Playgroud) jQuery或其他JavaScript库是否支持CSS4选择器?甚至浏览器?我该如何测试它们?
我在全球范围内安装了带有npm的http-server,但仍然得到"找不到命令"
怎么了
我的npm命令就是这样
npm install -g http-server
Run Code Online (Sandbox Code Playgroud)
和http运行命令
http-server -p 8000
Run Code Online (Sandbox Code Playgroud) 我在W3S - HTML Forms页面上查找表单属性,我看到,有两个相似的属性,至少我认为是这样。我不明白他们之间的区别。所以我想问一下,post的action和target有什么区别?
我正在使用Materialisecss,它使用Google设计图标.在某些手机上,可以显示Google Material-Icons.是什么造成的?
我尝试在输入的更改事件上比较输入的键代码,但是当我尝试时,我只看到 Proxy 对象而不是事件处理程序对象。我找不到任何解决方案。在另一个组件中我实现了它,但在这个组件中我不能。
我的处理函数是:
handleChange(event){
this.setState({
searchValue : this.searchInput.value
});
if(this.searchInput.value.length>2&&!this.state.recommendation&&this.focused){
this.setState({
recommendation:true
});
} else if(this.searchInput.value.length<3&&this.state.recommendation&&this.focused) {
this.setState({
recommendation:false
});
return;
}
console.log(event) //event is returned as Proxy object
if(event.keyCode === 13){
this.context.router.history.push(`/yardim/arama/${this.searchInput.value}`);
return;
}
if(this.searchInput.value.length>2){
this.bouncer.handle();
}
}
Run Code Online (Sandbox Code Playgroud)
和渲染功能是:
render(){
return(
<div id="faq-search-box">
{this.state.recommendation}
<i className="icon hb-icon-search_icon"></i>
<input id="faq-search-input" type="text" placeholder="Yard?m konusu ara..." value={this.state.searchValue} ref={input=>{this.searchInput=input;}} onChange={this.handleChange.bind(this)} onFocus={this.onFocus} onBlur={this.onBlur} />
<div className="clearfix"></div>
{ this.state.recommendation &&
<div id="faq-recommendation-box">
{this.props.FAQRecomendations&&
<ul>
{this.props.FAQRecomendations.map((faq)=>
<li key={faq.id}><a onMouseDown={(e)=>{this.onMouseDown(`/yardim/${faq.slug}#${faq.id}`,e)}} title={faq.name}>{faq.name}</a></li>
)}
</ul>
}
</div>
} …
Run Code Online (Sandbox Code Playgroud) javascript ×2
attributes ×1
components ×1
css3 ×1
data-binding ×1
forms ×1
html ×1
httpserver ×1
jquery ×1
materialize ×1
node.js ×1
npm ×1
reactjs ×1
svg ×1
vue.js ×1