0

I want add a LinearGradient in vue native but getting this error with the following code

<template>
    <View >
      <linear-gradient :colors="['#4c669f', '#3b5998', '#192f6a']">
         <text class="loginWording">login</text> 
      </linear-gradient>
    </View>
</template>
4

2 回答 2

0

你有没有尝试这样写:

<linear-gradient :colors="['#4c669f', '#3b5998', '#192f6a']">
   <view class="login">
     <text class="loginWording">login</text> 
   </view>
</linear-gradient>
于 2020-06-13T17:46:28.547 回答
0

您需要将颜色作为字符串数组传递

<LinearGradient colors={["#4c669f", "#3b5998", "#192f6a"]}>
   <view class="login">
     <text class="loginWording">login</text> 
   </view>
</LinearGradient>
于 2020-06-11T10:17:19.230 回答