我正在使用onsenui制作列表并做出反应.但我无法通过onchanged调用绑定.
我想不出来......有人能解决这个问题吗?
这是我的代码.我想从输入项调用handlechanged方法.但是,然后,无法读取属性'bind'的undefined被提出.
export default class MainPage extends React.Component {
constructor(props) {
super(props);
this.state = {
selectedValue: "myself",
destinations: ["myself","somebody"],
};
}
handleChange(value) {
this.setState({selectedValue: value});
}
renderRadioRow(row) {
return (
<ListItem key={row} tappable>
<label className='left'>
<Input
inputId={`radio-${row}`}
checked={row === this.selectedValue}
onChange={this.handleChange.bind(this, row)}
type='radio'
/>
</label>
<label htmlFor={`radio-${row}`} className='center'>
{row}
</label>
</ListItem>
)
}
render() {
return (
<Page renderToolbar={this.renderToolbar}>
<p style={{textAlign: 'center'}}>
test
</p>
<List
dataSource={this.state.destinations}
renderRow={this.renderRadioRow}
/>
</Page>
);
}
}Run Code Online (Sandbox Code Playgroud)
我正在尝试使用此命令安装monaca。
npm install -g monaca
Run Code Online (Sandbox Code Playgroud)
但是在收到这些错误之后:
npm WARN checkPermissions缺少对/ usr / local / lib / node_modules的写权限npm ERR!路径/ usr / local / lib / node_modules npm错误!代码EACCES npm ERR!errno -13 npm错误!syscall访问npm ERR!错误:EACCES:权限被拒绝,访问'/ usr / local / lib / node_modules'npm ERR!{错误:EACCES:权限被拒绝,访问'/ usr / local / lib / node_modules'npm ERR!堆栈:'错误:EACCES:权限被拒绝,访问\'/ usr / local / lib / node_modules \'',npm ERR!errno:-13,npm错误!代码:“ EACCES”,npm错误!syscall:“访问”,npm错误!路径:'/ usr / local / lib / node_modules'}
任何想法如何解决这个问题?谢谢
我使用 Monaca、Cordova 和 onsenUI 构建了一个基于 Vue.js 的应用程序。我想在我的页面中使用 Google 地图显示我的位置。为了实现这一点,我使用了一个npm包,vue2-google-maps但它没有显示任何内容。
我使用的代码来自软件包的官方文档。它们如下所示:
<template>
<v-ons-page>
<custom-toolbar>Page 1</custom-toolbar>
<div>
<gmap-map
:center="center"
:zoom="7"
style="width: 500px; height: 300px"
>
<gmap-marker
:key="index"
v-for="(m, index) in markers"
:position="m.position"
:clickable="true"
:draggable="true"
@click="center=m.position"
></gmap-marker>
</gmap-map>
</div>
</v-ons-page>
</template>
<script>
import * as VueGoogleMaps from 'vue2-google-maps';
import Vue from 'vue';
Vue.use(VueGoogleMaps, {
load: {
key: 'AIzaSyDX3SEHwFUY-k_Jp7YMp0-uTvo7up-paXM',
v: '3.26',
// libraries: 'places', //// If you need to use place input
}
});
export default {
data () { …Run Code Online (Sandbox Code Playgroud) 我想在进入主页面之前设置登录页面.我怎么能在这个指令之前做到这一点:
<ons-screen page="sliding_menu.html"></ons-screen>
Run Code Online (Sandbox Code Playgroud)
我使用Monaca IDE
谢谢您的帮助
查尔斯
我有一个列表,其中包含允许用户点击的项目.单击某个项目会将用户带到详细信息页面.如果你点击足够快,可能会触发两个点击事件,将用户带到一个详细信息页面,然后是另一个.有办法防止这种情况吗?例如,您可以告诉导航器在导航完成之前不要推送另一页吗?
这是我的代码在填充列表后调用,分配click事件:
$( '#myList .item', this ).on( 'click', function() {
navi.pushPage( "details.html" ) );
});
Run Code Online (Sandbox Code Playgroud) javascript ×5
monaca ×5
onsen-ui ×2
reactjs ×2
cordova ×1
ecmascript-6 ×1
google-maps ×1
jquery ×1
macos ×1
mobile ×1
npm ×1
vue.js ×1