Skip to content

Instantly share code, notes, and snippets.

@wongyouth
Created September 27, 2018 16:14
Show Gist options
  • Save wongyouth/d037904fecabd9d2a69a51d7d7a88a5c to your computer and use it in GitHub Desktop.
Save wongyouth/d037904fecabd9d2a69a51d7d7a88a5c to your computer and use it in GitHub Desktop.
用于 nideshop-mpvue 原生转mpvue用
sed -i '' \
-e 's/that\.data/that/' \
-e 's/this\.data/this/' \
-e 's/that\.setData(/Object.assign(that.$data, /' \
-e 's/this\.setData(/Object.assign(this.$data, /' \
-e 's!//\([^ ]\)!// \1!' \
-e 's/function(/function (/' \
-e 's/^\( *\)\([^ (.]\{1,\}\)(/\1\2 (/' \
-e 's/ == / === /' \
-e 's/ *;? *$//' \
-e 's/^\( *\)view\./\1./' \
-e 's/wx:if/v-if/' \
-e 's/wx:for/v-for/' \
-e 's/wx:key/:key/' \
-e 's/bindtap/@click/g' \
-e "s/'{{\(.*\)}}'/'\1'/g" \
$1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment