0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

vue.jsのscope id計算方法

Posted at

全く別のvueモジュールとscoped cssのID(data-v-xxxx の様な値)が被ったので調べた。

2020/01/26時点ではここが計算元
https://github.com/vuejs/vue-loader/blob/74febfc280/lib/index.js#L94

  const id = hash(
    isProduction
      ? (shortFilePath + '\n' + source)
      : shortFilePath
  )

shortFilePathはsrc/index.vueの様な値。この値の場合、ハッシュ値は2964abc9になる。

image.png

Productionビルドにするとソースコードも含まれるので被ることは無さそう。自分用だとdevelopmentビルドをそのまま使っていたので引っかかってしまった。困った

0
0
0

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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?