我在addon/component/my-component.js
:
import Ember from 'ember';
import layout from '../templates/components/my-component';
import myMixin from '../mixins/my-mixin';
export default Ember.Component.extend(myMixin,{
layout
});
然而,这样做给了我
Uncaught Error: Could not find module foo/mixins/my-mixin imported from foo/components/my-component
my-mixin.js
的路径为app/mixins/my-mixin
。
在给定上述结构的情况下,如何导入我的mixin?谢谢。
答案 0 :(得分:0)
data(mtcars)
head(mtcars)
mtcars$am <- as.factor(mtcars$am)
library(ggplot2)
library(GGally)
lowerFn <- function(data, mapping, ...) {
p <- ggplot(data = data, mapping = mapping) +
geom_point(color = 'blue', alpha=0.3, size=4) +
geom_smooth(color = 'black', method='lm', size=1,...)
p
}
g <- ggpairs(
data = mtcars,
lower = list(
continuous = wrap(lowerFn) #wrap("smooth", alpha = 0.3, color = "blue", lwd=1)
),
upper = list(continuous = wrap("cor", size = 5))
)
g <- g + theme(
axis.text = element_text(size = 6),
axis.title = element_text(size = 6),
legend.background = element_rect(fill = "white"),
panel.grid.major = element_line(colour = NA),
panel.grid.minor = element_blank(),
panel.background = element_rect(fill = "grey95")
)
print(g, bottomHeightProportion = 0.5, leftWidthProportion = .5)
文件位于my-component.js
目录中,因此将addon/component
文件放在my-mixin.js
目录中可以解决您的问题。