pug-html-loader icon indicating copy to clipboard operation
pug-html-loader copied to clipboard

fixed param data error

Open zhaozhuo opened this issue 8 years ago • 2 comments

zhaozhuo avatar Apr 17 '17 10:04 zhaozhuo

@denver23 if I console.log query I have an object like this

{ 'options[debug]': true,
  'options[compileDebug]': true,
  'options[pretty]': true,
  'options[data][title]': 'hello',
  'options[data][home][title]': 'Lorem Title',
  'options[data][home][sections][hero][title]': 'Lorem ipsum dolor sit' 
}

but if I console log data

let data = typeof query.data === 'object' ? query.data : JSON.parse(query.data || '{}')
console.log(data)

data is ever {}

can you help me?

bardaxx avatar Jun 24 '17 11:06 bardaxx

@giacomoalonzi Please try to access your data parameters as title instead data.title

willyelm avatar Jun 24 '17 13:06 willyelm