我有兴趣在头像(个人资料图片)上创建一个自定义徽章,除了我似乎无法让图像重叠.我尝试使用'translateY'样式转换,但它被忽略,两个图像仍然并排放置,flex盒式,即使我希望它们重叠.注意,我在示例中使用了Views,但我想象Images的工作方式相同.
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
View,
} = React;
var SampleApp = React.createClass({
render: function() {
return (
<View style={styles.container}>
<View style={styles.avatar} />
<View style={styles.badge} />
</View>
);
}
});
var styles = StyleSheet.create({
container: {
},
avatar: {
backgroundColor: 'black',
width: 60,
height: 60,
},
badge: {
backgroundColor: 'red',
width: 20,
height: 20,
translateY: -60,
},
});
AppRegistry.registerComponent('SampleApp', () => SampleApp);
Run Code Online (Sandbox Code Playgroud) 我正在使用 Svelte 和 Rollup。我一直使用 npm run dev 获得了很棒的开发服务器体验。现在,尽管开发服务器似乎停留在我的应用程序的旧版本上。如果我使用 run build 进行部署,我会得到最新的更改,但 npm run dev 每次都会尝试运行昨天的相同内容。我认为这可能是浏览器会话/cookie 问题,因为 chrome 隐身选项卡中的 localhost:5000 提供了最新版本...但现在它也停留在该版本上,并且在我进行和保存更改时不会更新。有小费吗?
你能在 Svelte 中通过 props 传递数组吗?
<script>
import List
let array = [];
console.log(array);
</script>
<List list=array/>
Run Code Online (Sandbox Code Playgroud)
<script>
export let array;
console.log(array);
</script>
Run Code Online (Sandbox Code Playgroud)
这将产生: (1st log) [] (2nd log) 数组
但我认为它会产生(第一个日志)[](第二个日志)[]