小编Kam*_*cek的帖子

如何在Vue.js中的父母和孙子之间进行双向数据绑定

我遇到了一个问题,我通过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)

data-binding components vue.js

24
推荐指数
2
解决办法
3万
查看次数

jQuery是否支持CSS4选择器?

jQuery或其他JavaScript库是否支持CSS4选择器?甚至浏览器?我该如何测试它们?

javascript jquery css-selectors jquery-selectors

8
推荐指数
1
解决办法
307
查看次数

在NPM中安装后找不到Http-Server命令

我在全球范围内安装了带有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)

httpserver node.js npm

6
推荐指数
1
解决办法
3万
查看次数

动作和帖子目标之间有什么区别?

我在W3S - HTML Forms页面上查找表单属性,我看到,有两个相似的属性,至少我认为是这样。我不明白他们之间的区别。所以我想问一下,post的action和target有什么区别?

html forms attributes

6
推荐指数
1
解决办法
2976
查看次数

为什么无法在移动设备上显示Google Material Icons

我正在使用Materialisecss,它使用Google设计图标.在某些手机上,可以显示Google Material-Icons.是什么造成的?

在此输入图像描述

svg text-rendering css3 materialize material-design

4
推荐指数
1
解决办法
2015
查看次数

onClick 事件返回代理对象而不是 ReactJX 中的事件处理程序对象

我尝试在输入的更改事件上比较输入的键代码,但是当我尝试时,我只看到 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 reactjs

2
推荐指数
1
解决办法
2059
查看次数