LoginSignup
0

More than 5 years have passed since last update.

eachの中からoptsへアクセス

Last updated at Posted at 2016-10-07

eachを使った繰り返し処理の中で、optsへのアクセスが必要になったため、
試行錯誤したところ、以下の方法でアクセスできたのでメモ。

  • thisは省略可能です
{this.parent.opts.xxxx}

あんまりいい例ではないですが、例えば

<!-- 例) input type はoptsで指定したものを使いたい -->
<div each="{input in inputs}">
    <input type="{parent.opts.input_type}"
        name="{input.name}"
        value="{input.value}">
</div>

とか。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0