这是一个带有参数化 getter的 Vuex Store 示例,我需要将其映射到 Vue 实例以在模板中使用。
const store = new Vuex.Store({
state: {
lower: 5,
higher: 10,
unrelated: 3
},
getters: {
inRange: state => value => {
console.log('inRange run')
return (state.lower <= value) && (state.higher >= value)
}
},
mutations: {
reduceLower: state => state.lower--,
incrementUnrelated: state => state.unrelated++
}
})
new Vue({
el: '#app',
template: "<div>{{ inRange(4) }}, {{ unrelated }}</div>",
store,
computed: Object.assign(
Vuex.mapGetters(['inRange']),
Vuex.mapState(['unrelated'])
),
})
setTimeout(function() {
console.log('reduceLower')
store.commit('reduceLower')
setTimeout(function() {
console.log('incrementUnrelated') …Run Code Online (Sandbox Code Playgroud)是否可以接受以下任何XPath表达式?使用eclipselink的2.3.1版
@XmlPath("../header/@type")
@XmlPath("/root/header/@type")
@XmlPath("parent::*/header/@type")
Run Code Online (Sandbox Code Playgroud)
基本上这是在XML文档(/root/tag)中重复的类中,如果不清楚我会详细说明.
我试图遍历树而不是向下.我的其他@XmlPath注释工作正常.