{"action":"opened","issue":{"url":"https://api.github.com/repos/Meituan-Dianping/mpvue/issues/620","repository_url":"https://api.github.com/repos/Meituan-Dianping/mpvue","labels_url":"https://api.github.com/repos/Meituan-Dianping/mpvue/issues/620/labels{/name}","comments_url":"https://api.github.com/repos/Meituan-Dianping/mpvue/issues/620/comments","events_url":"https://api.github.com/repos/Meituan-Dianping/mpvue/issues/620/events","html_url":"https://github.com/Meituan-Dianping/mpvue/issues/620","id":331028707,"node_id":"MDU6SXNzdWUzMzEwMjg3MDc=","number":620,"title":"v-bind=\"$attrs\" 不起作用","user":{"login":"banxi1988","id":726774,"node_id":"MDQ6VXNlcjcyNjc3NA==","avatar_url":"https://avatars1.githubusercontent.com/u/726774?v=4","gravatar_id":"","url":"https://api.github.com/users/banxi1988","html_url":"https://github.com/banxi1988","followers_url":"https://api.github.com/users/banxi1988/followers","following_url":"https://api.github.com/users/banxi1988/following{/other_user}","gists_url":"https://api.github.com/users/banxi1988/gists{/gist_id}","starred_url":"https://api.github.com/users/banxi1988/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/banxi1988/subscriptions","organizations_url":"https://api.github.com/users/banxi1988/orgs","repos_url":"https://api.github.com/users/banxi1988/repos","events_url":"https://api.github.com/users/banxi1988/events{/privacy}","received_events_url":"https://api.github.com/users/banxi1988/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-11T02:41:18Z","updated_at":"2018-06-11T02:41:18Z","closed_at":null,"author_association":"NONE","body":"# v-bind=\"$attrs\" 不起作用。\r\n\r\n**问题复现步骤:**\r\n 封装一个 WeuiNavCell\r\n 对应代码如下：\r\n\r\n```html\r\n<template>\r\n <navigator\r\n   v-bind=\"attrs\"\r\n   class=\"weui-cell\"\r\n   :class=\"{'weui-cell_access': access}\"\r\n  >\r\n</template>\r\n```\r\n由于小程序中 `navigator` 属性众多，如果一个个照搬的话，比如麻烦后面维护也麻烦。\r\n然后见到 vue 早已支持这种 v-bind=\"$attrs\" 的写法。\r\n\r\n对应使用代码：\r\n\r\n```html\r\n <weui-nav-cell\r\n       hover-class=\"navigator-hover\"\r\n       url=\"/pages/other/main\"\r\n      title=\"标题文案\"  detail=\"说明文案\" />\r\n```\r\n\r\n**期望的表现:**\r\n处理 `v-bind=\"$attrs\"` 将  父组件中的 `hover-class` 及 `url` 等属性绑定到组件类的 `navigator` 中。\r\n\r\n**观察到的表现:**\r\n没有绑定"}}
{"actor":{"display_login":"banxi1988"}}